.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with Dynamic Button

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Hi friends,

I am trying to make a page inspired from http://login.qlikview.com/help.aspx

here I have made a dropdownlist and on clicking I am able to dynamically add the textboxes and radio buttons using placeholders. My problem is I am not able to use a dynamic number of submit buttons. In the page (link above) I need to make the submit button available for two choices and invisible for one.  But the option dynamicbutton is not available alike dynamicTextboxes etc. What could I do? Is there any other way I could figure out to implement this.

Thanking you in advance,


View Complete Post

More Related Resource Links

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Problem with Dynamic Controls



I have a custom user control that contains within it a repeater control. Inside this repeater I programmatically add another custom user control, which contains a text box and a custom validator. This final custom user control can be added any number of times depending on the application's logic. All of this is part of a wizard step.

When the user completes the step, if any of the data added to the text boxes is incorrect the validator gets fired on post back. However, because I can have any number of these controls added to the repeater, the user has to scroll down to see any of the incorrectly completed boxes.

Due to the controls being added dynamically it is not possible to use a validation summary control - I have tried!!! Therefore, is there away I can use JavaScript to position a cursor or to jump to each incorrectly completed textbox without the user needing to scroll down the page? For example, if there are 10 textboxes, and textboxes 8 and 9 have numbers inside them inside strings, then the JavaScript should jump textbox 9.

add any number of dynamic controls on press of button

how can i add new control like image on every click of a button. the number of controls added should be number of times i pressed that button

dynamic button text vertical

I want to have vertical text in a button created at run time.If it is a label "writing-mode:tb-rl;filter: flipv fliph;" this code works but for button it is not.

Problem with Dynamic Controls inside an UpdatePanel

Hello Everybody ,I have this problem,if anyone could help me i'll be so gratefull. I had been created some dynamic radio buttons in a loop inside a dinamy table which is inside an UpdatePanel , but i can not handle the events my code is below:public void MetodoCreacion(){RadioButton RBtn = null;Table table = new Table();TableRow row = null;TableCell cell = null;for (int i = 0; i < 5; i++){row = new TableRow();cell = new TableCell();RBtn = new RadioButton();RBtn.ID = "RBGN_" + i.ToString();RBtn.GroupName = "RBGN1";RBtn.Text = "Opcion " + i.ToString();RBtn.CheckedChanged += new EventHandler(RBtn_CheckedChanged);RBtn.AutoPostBack = true;cell.Controls.Add(RBtn);row.Controls.Add(cell);table.Controls.Add(row);}UpdatePanel1_UpdatePanelAnimationExtender.Controls .Add(table);}public void RBtn_CheckedChanged (object sender, EventArgs e){Label1.Text = ((RadioButton)sender).ID;}and the controls doesent call the event ...thanks a lot

logout problem(after logout when clicking on back button after logout still opens the previous page

I am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout?on Logout.aspx load im using this code//=================//        Session.Clear();        Response.Buffer = true;        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);        Response.Expires = -1500;        Response.CacheControl = "no-cache";        //----- Second Technique : To Stop Caching of Secure Pages.        Response.Cache.SetCacheability(HttpCacheability.NoCache);        FormsAuthentication.SignOut();        if (Session["UserName"] == null)        {            Response.Redirect("login.aspx");        }       Session.Clear();         Response.Buffer = true;         Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);         Response.Expires = -1500;         Response.CacheControl = "no-cac

asp.net mvc multi button on same page problem

On my employee edit view page i have 3 buttons Save,Cancel,Delete.Save - saving view page values. calling controller action.Cancel - Go back to previous view page. (List of employee page. where this page view comes)Delete - Delete current page employee and go back to List of employee page. where this page view comes.Save button click by default working for me calling controller.but when i click cancel and delete button same controller gets callHow to handle this situation on page view.

Dynamic Text Boxes Creation Problem

Hi all, I am creating 5 textboxes in a row. A new creates when user press enter in the last textbox. I have taken a hidden text field and in OnKeyDown of last textbox I am assigning the combination of last textbox Id with the table count  to the hidden field and in VB Code I am checking whether the tableCount + Last textbox Id is equal to the hidden field or not then only I am generating the new row. here is the code In JavaScript On KeyDown of remarks textfield. function funcNewRow(id,count,e) {    var e = event || evt;    var charCode = e.which || e.keyCode;    if(charCode == 13){      e = cancelKey(e);      htxtBox.value = id + count;    } }   In VB Page_load method calling getTableRow() method   if htxtBox.value = "remarks" & (Tbl.Rows.Count + ViewState("TotalClearedItems")) Then  Tbl.Rows.Add(GetTableRow(Tbl.Rows.Count + 1 + ViewState(Panel1.Controls.Add(Tbl))  Panel1.Controls.add(Tbl) htxtBox.Value = "" end if   Here I have to implement a clear functionality such as each row at last contains a check box when user click the check box and press clear button the checked rows have to deleted .   The clear button code as follows : cnt = CInt(Tbl.Rows.Count)  For i = cnt To 1 Step -1 c = Pag

Problem with displaying and processing dynamic data


I need to dynamically generate a list of images in table format.  The images can be found in either art or picts, in temp, or in temp and in one of the other two (duplicate image). 

The idea is to display any duplicates prior to copying anything over from temp to either art or picts, so I'm thinking of adding radio buttons if the same image is found in two folders.  I also want to add a submit button.  The user selects the image they want and clicks the button.  If they want the new file it's copied over then deleted.  If they want to keep the existing file the new one is just deleted.  If they select nothing, both versions of the file are deleted.  So the table will look something like this:

temp         art            picts         process
z-123                                           delete button
() z-234                       () z-234  

hover-ad creator Problem + Close button is not showing in IE



close button is not showing in IE. working fine in FF and others.

Please help SmileSmile

ModalPopupExtender problem with browser back button


ModalPopUpExtender shows popup when user clicks browser back button.

I saw this thread but I could find the solution for this problem.


mesajrapor1 is my user control which contains the modalpopupextender

Here is my code:


protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        HyperLink hyp = (HyperLink)e.Item.FindControl("hypGonderenAD");
        Label lblicer = (Label)e.Item.FindControl("lblIcerikMesaj");
        Label midlbl = (Label)e.Item.FindControl("lblIdMesaj");
        Label sidlbl = (Label)e.Item.FindControl("Label3");

        if (e.CommandName == "SikayetEt")
            mesajrapor1.RaporGonder(hyp.Text.ToString(), lblicer.Text.ToString(), Convert.ToInt32(midlbl.Text), Convert.ToInt32(sidlbl.Text));

Help! Can't find dynamic button's postback in page.request.form??


Okay, I know that dynamic buttons and buttons in general don't use a typical postback and they post through the page.request.form.  Okay, so in visual studio, I was able to determine that page.Request.form and in the all-keys property, i SEE my button there.  It is the last item in all-keys.

When I am clicking this dynamic button which is in an updatepanel, the script below does not detect it as a button, it is still showing it as null:

public static Control GetPostBackControl(Page page)

            Control control = null;
            string ctrlname = page.Request.Params.Get("__EVENTTARGET");
            if (ctrlname != null && ctrlname != string.Empty)
                control = page.FindControl(ctrlname);

have problem to redirect page , on cancel button click



i am doing simple login page and i used to required field validator to validate user name and password text box.

and there are two buttons submit and cancel.

now i want to redirect this page to home.aspx after clicking on cancel button, but that two required fields validator get pop up and i get stuck in login page.

 if anyone knows how to solve this problem please tell me..

thanks, in advance for your valuable time. 

Problem of refreshing the button on submit


 I am doing  a project in asp.net with visual studio2008. Im my project i did the java script validation and in a button a write the code to redirect the page to another page. But when i click the button it shows the java script alert message but at the same time it directed to another page. Pls help me do proceed in my work.....

Tkanks in advance

Dynamic routing problem when invoking site from remote host.



I have problem described under following link: mvcrouting

Can someone give me some clues how to deal with that ?


Dynamic LINQ Where problem




I stumbled upon a problem while using Dynamic LINQ which is provided by Scott Guthrie. Basically I need a functionality where the user would be able to search by anything while on a gridview. Now the issue is that when the field to be searched is a string it works without problems, when it is an interger it is giving me a {"Operator '=' incompatible with operand types 'Int32?' and 'String'"}. Now the issue is that I would not be able to know what datatype the field is. If I convert the data to an INT it works without problems, but as I said I cannot since I would not be able to know beforehand the database data type. The place where it is giving me the error is shown in bold.


The second issue is that I have a CONTAINS functionality where the user would be able to type in anything and the system will create a CONTAINS linq statement to search for data. For one field it works without problems, while for another field the CONTAINS does not work and it gives me an OBJECT NOT SET TO AN INSTANCE when I try to access the list.  The code is shown underneath. I am using MVC and jqGrid.

private static string BuildWhereClause(JQGridRequest.SearchOperatorOptions SearchOperator, string FieldName)




problem in asp:menu font after clicking the button...


i've got this problem in asp:menu once i click a submit button the asp:menu font is change... also the drop menu got a space... how can i solve this problem any help???

im using c# .net

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend