CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 12/31/2007 7:57:14 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
shuklaanupam
Asp.Net User
delete a textbox randomly in web part12/31/2007 7:57:14 AM

0/0

hi,

     i m creating a web part for "todolist", in that randomly creating the textbox and writing some content in textbox. anyone can help me how to delete a specific textbox.. 

aadreja
Asp.Net User
Re: delete a textbox randomly in web part12/31/2007 11:52:20 AM

0/0

webpart1.Controls.RemoveAt(0); // here you can generate any random number within your range instead of 0

OR

webpart1.Controls.Remove(TextBox1);

 


Thanks,
Ritesh

---------------------------------------------
Please do not forget to mark as Answer if my reply is helpful.
shuklaanupam
Asp.Net User
Re: delete a textbox randomly in web part1/1/2008 7:24:19 AM

0/0

hi,

     thnx... i m creating the textbox dynamically so i will not be knowing there name or id.. in web part when i click on "todo" link button, it creates a new textbox.. in front of every textbox i need a delete button, which delets that textbox.. if you hav any sample code for that, plz send to me.. (if you go to netvibes.com, you can find todolist.. i want like that)..

thnx for ur help...

 

aadreja
Asp.Net User
Re: delete a textbox randomly in web part1/1/2008 8:28:08 AM

0/0

then you would be creating links also, correct
which control are you using to create todolist is it ListView or GridView?

Let me know so i can give you proper solution.


Thanks,
Ritesh

---------------------------------------------
Please do not forget to mark as Answer if my reply is helpful.
shuklaanupam
Asp.Net User
Re: delete a textbox randomly in web part1/1/2008 12:59:06 PM

0/0

hi,

i m using the panel, in that panel when we click on 'new to do' it creates a new textbox and display it in the panel.. here is my code which i m using---->

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebPartPages;
using System.Drawing;

 

namespace TodoList
{

    /// <summary>
    /// Description for TodoList.
    /// </summary>
    [DefaultProperty("Text"),
        ToolboxData("<{0}:TodoList runat=server></{0}:TodoList>"),
        XmlRoot(Namespace = "TodoList")]
    public class TodoList : Microsoft.SharePoint.WebPartPages.WebPart
    {

        static TextBox[] txt_arr = new TextBox[20];
        public static int txt_count;
        public TextBox tempBox,txtData;
        public LinkButton NewTodo;
        public LinkButton edit, save, add;
        public Panel pnlMain,btnPanel,userPanel;
        public GridView Grid;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
               
                if (txt_arr[0] is TextBox)
                {
                    //for each button saved in our array, recreate it
                    foreach (TextBox txtbox in txt_arr)
                    {
                        add_txtbox(txtbox);
                    }

                }
            }
            catch (Exception ex)
            {
                //lblStatus.Text += ex.Message.ToString();
            }
        }
        protected override void OnPreRender(EventArgs e)
        {
            //Controls.Add(pnlMain);
            try
            {

                if (txt_arr[0] is TextBox)
                {
                    //for each button saved in our array, recreate it
                    foreach (TextBox txtbox in txt_arr)
                    {
                       
                        add_txtbox(txtbox);
                    }

                }
            }
            catch (Exception ex)
            {
                //lblStatus.Text += ex.Message.ToString();
            }
            base.OnPreRender(e);
        }
        protected override void CreateChildControls()
        {
            this.Controls.Clear();   
           
            //main panel properties
            pnlMain = new Panel();
            pnlMain.ID = "pnlMain";
            Controls.Add(pnlMain);
            pnlMain.Height = 100;
            pnlMain.BackColor = Color.AliceBlue;

            btnPanel = new Panel();
            Controls.Add(btnPanel);
            btnPanel.Visible = false;
            btnPanel.BackColor = Color.Black;
                   // base.CreateChildControls();
            userPanel = new Panel();
            Controls.Add(userPanel);
           userPanel.BackColor= System.Drawing.ColorTranslator.FromHtml("#5A8DC5");

 

            add = new LinkButton();
            add.Text = "[ADD]";
            Controls.Add(add);
            add.Click+=new EventHandler(add_Click);
             btnPanel.Controls.Add(add);

            save = new LinkButton();
            save.Text = "[SAVE]";
            Controls.Add(save);
            save.Click+=new EventHandler(save_Click);
           btnPanel.Controls.Add(save);

           edit = new LinkButton();
           edit.Text = "[EDIT]";
           Controls.Add(edit);
            edit.Click+=new EventHandler(edit_Click);
            userPanel.Controls.Add(edit);

 

            txtData = new TextBox();
            Controls.Add(txtData);
            //txtData.TextChanged+=new EventHandler(txtData_TextChanged);
            btnPanel.Controls.Add(txtData);


            //Link button propeties........
            NewTodo = new LinkButton();
            NewTodo.ID = "NewTodo";
            NewTodo.Text = "[NewTodo]";
            Controls.Add(NewTodo);
            NewTodo.Click += new EventHandler(NewTodo_Click);
            userPanel.Controls.Add(NewTodo);
            base.CreateChildControls();;
        }

        protected void add_txtbox(TextBox txtBox)
        {
            try
            {
                //add to a container on the page
                pnlMain.Controls.Add(txtBox);
                //add a spacer after the control
                pnlMain.Controls.Add(new LiteralControl("<br>"));
              
            }
            catch (Exception ex)
            {
                throw new Exception("can't create text box", ex);
            }
        }

      
        public void save_function()
        {
            tempBox = txtData;  
            try
            {
               
                TextBox new_txtbox = new TextBox();
                new_txtbox.ID = "" + (txt_count + 1);
                txt_arr[txt_count++] = new_txtbox;
                new_txtbox.Text = tempBox.Text;
                add_txtbox(new_txtbox);
                             
             }
            catch (Exception ex)
            {
            }

        }
        protected void NewTodo_Click(object sender, EventArgs e)
        {
            Controls.Add(btnPanel);
            btnPanel.Visible = false;
            save_function();
        }
        protected void edit_Click(object sender, EventArgs e)
        {
            //Controls.Add(btnPanel);
            btnPanel.Visible = true;
           
        }
        protected void save_Click(object sender, EventArgs e)
        {
            //Controls.Add(btnPanel);
            btnPanel.Visible = false;
            save_function();
          
           
        }
        //protected void txtData_TextChanged(object sender, EventArgs e)
        //{
        //    save_function();
          
        //}

        protected void add_Click(object sender, EventArgs e)
        {
            //Controls.Add(btnPanel);
            btnPanel.Visible = true;
            save_function();
            //Controls.Add(btnPanel);
          
        }
      
    

    }

}

 

this is the code, it execute on server but does't execute well.. so pz check this code,it give some error then let me know... in this code in front of every textbox i need a delete button which deletes that textbox... i m trying with this for a long time, but not able to solve..

thanx in advance...

shuklaanupam
Asp.Net User
Re: how to retain the data after refresh in a textarea1/3/2008 8:04:16 AM

0/0

hi,

     i m creating a webnote webpart in that creating a simple textarea. the user can write into the text area but when we refresh the page, the data in text area will be deleted.. i want it to be remain there, plz tell.. how can i do it..

anupam..

shuklaanupam
Asp.Net User
Re: delete a textbox randomly in web part1/3/2008 9:12:52 AM

0/0

hi, 

i need to implement a grid view list in the webpart, how can i do that.. if u hav code sample , then plz send to me... i don't have idea on this...

thnx...

 

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Flash MX 2004 Games: Art to ActionScript Authors: Nik Lever, Pages: 448, Published: 2004
Natural Language Processing: IJCNLP 2004 : First International Joint Conference, Hainan Island, China, March 22-24, 2004 : Revised Selected Papers Authors: Keh-Yih Su, Asia Federation of Natural Language Processing, Pages: 817, Published: 2004
Microsoft FrontPage 2002 Unleashed Authors: William R. Stanek, David Berry, Duane Hellums, Mark Ray, Jinjer Simon, Pages: 1184, Published: 2002

Web:
Random Image Web Part for Smart Part - Release: 0.9 Sep 3, 2008 ... Random Image Web Part for Smart Part ..... When errors are generated, they will not be displayed as a text box in the web part. ...
CSS textbox issues > DotNetNuke Module Product Forums > Data ... With a textbox on the form it seems that Override field style class? is overrriding ... Random Rounded Images ... About SharePoint Content Query Web Part ...
HIOX FREE JavaSCRIPT - Remove Html tags textarea - Strip tag ... Random Generator. Select All. Form Validation. Textbox Counter. Dynamic Form select ... Copy the javascript code into the head part of your HTML page. ...
Portals: Unleash Your Site's Potential with Web Parts and ... Writing your own Web Parts is easy. There are actually three different ways .... the value passed in from a TextBox, the code would be something like this: ...
Coding Horror: Web Forms: Death By a Thousand Textboxes That's a very good thing - I don't want random websites to have access to my clipboard ..... That's part of why I'm saying that multi-line textboxes aren't ...
Count words entered in a text box or HTML TEXTAREA element of web ... JavaScript code that counts words entered in a HTML TEXTAREA element or a form text box on a web page and limiting visitor inputs via such text boxes.
dinamically created webparts disappear after postback - ASP.NET Forums WebPartZone wpz1; WebPartZone wpz2; WebPart wp1; TextBox txtbox1; ... to the fact AddWebPart method gives the WebPart a random id and therefore it enters in ...
TheMSsForum.com >> Publisher >> How can I fill a text box with ... Moving text from a web page to Pub '03 How can I more easily ... Cheers PT Tag: How can I fill a text box with random text in Publisher? ...
MarkItUp - Preventing a web part being moved Adding/Added; Closing/Closed; Deleting/Deleted; Moving/Moved ... Inside zone1 we have 2 generic web parts - a textbox and a calendar - and inside zone 2 we ...
Captcha field textbox cannot be styled > DotNetNuke Module Product ... Random Rounded Images ... About SharePoint Content Query Web Part .... The second part in bold should be styled like otther textboxes. ...

Videos:
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming environmen...




Search This Site:










need help with print margin issue with html email

web.config authentication

clean dnn 4.02 install issue

fetching existing ad windows accounts from code

insert command

type 'sqlhelper' is not declared error

code for the placing a link to a textfile which exists in my project.

user and administrator authentification

dotnetnuke scheduling module

xp sp2 with dnn

professional dotnetnuke asp.net portals book??

inserting items using single query

response.redirect or server.transfer cancels log-in session

utilizing skins to define display of web part data source

free ibuyspy store ms access conversion in vb

using web.config configurationsettings in vb code behind page

unable to use webclient on external sites

problem with datareader or arraylist in cbo?

login programatically

dnn4 solpart menu changes?

how to add items to moduletitle_menu ?

<location><authorization> problems!

3.0.12 cannot delete custom module...

can't edit item template in details view

dnn308: configure new module in vs

svg and masterpage incompatibility

is there an example of how to add this functionality to an existing application?

can i use an image in a class?

forms authentication

setting focus

 
All Times Are GMT