Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Burak #1
Problem with Dynamically Creating Link Buttons
Hello,
This is my code behind code for dynamic link button creation:
strUrl = "<asp:LinkButton CommandName='Onet3_Cd'
onfiltered='LinkButton_Command' runat='server' " & _
"Text='" & rdrOnet3("ONET3_TITLE") & "'
CommandArgument='" & rdrOnet3("ONET3_CD") & "' id='lb"
& i & "'></asp:LinkButton>"
Dim ctrl As Control =
Page.ParseControl(strUrl.ToString())
plcCategory.Controls.Add(ctrl) ' place holder on html page
The link button shows up fine when I run this, but
when I click on the link, it doesn't take me to
Sub LinkButton_Command(ByVal sender As Object, ByVal e
As CommandEventArgs)
Dim strDesc As String
strDesc = sender.text
Response.Write(sender.text)
End Sub
I based my code on
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr\[/url]
fsystemwebuiwebcontrolslinkbuttonclasscommandnamet opic.asp
The click works if I hard code the link button on the
html page, but if I create it dynamically, the click
does not take me to the above sub.
Do you know how to fix this?
Thanks,
Burak
Burak Guest
-
Problem with creating External Link
Hi, In Contribute 3.1 - I cannot create an external link to this address: ... -
Security problem when dynamically creating directories
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a... -
Dynamically creating buttons per row: how?
I'm working on a web application that will use some datagrid and asp.net, an asp.net Forum to be exact where people can leave posts and respond to... -
Dynamically creating buttons in custom datagrid control
Hi, I am creating a custom control datagrid. For each dynamically created column I've added a button in the header that will filter based on the... -
Creating onClick event for dynamically (programatically) created buttons
Hello all! My question is the following: I add buttons (server controls) programatically into a table cell. Example: Dim btObnovi As Button =... -
BK #2
Problem with Dynamically Creating Link Buttons
Burak,
From what I understand, since you are creating the
imagebutton dynamically you have to make sure that you add
the imagebutton on every page load for your button_click
event to work.So make sure what ever code you are adding
to add the imagebutton dynamically is executed on every
page load.
Hope this helps
BK
creation:>-----Original Message-----
>Hello,
>
>This is my code behind code for dynamic link buttonhtml page>
>strUrl = "<asp:LinkButton CommandName='Onet3_Cd'
>onfiltered='LinkButton_Command' runat='server' " & _
>"Text='" & rdrOnet3("ONET3_TITLE") & "'
>CommandArgument='" & rdrOnet3("ONET3_CD") & "' id='lb"
>& i & "'></asp:LinkButton>"
>
>Dim ctrl As Control =
>Page.ParseControl(strUrl.ToString())
>plcCategory.Controls.Add(ctrl) ' place holder onurl=/library/en-us/cpref/html/frlr\>
>The link button shows up fine when I run this, but
>when I click on the link, it doesn't take me to
>
>Sub LinkButton_Command(ByVal sender As Object, ByVal e
>As CommandEventArgs)
>
>Dim strDesc As String
>strDesc = sender.text
>Response.Write(sender.text)
>End Sub
>
>I based my code on
>
>[url]http://msdn.microsoft.com/library/default.asp?[/url]>fsystemwebuiwebcontrolslinkbuttonclasscommandname topic.asp
>
>The click works if I hard code the link button on the
>html page, but if I create it dynamically, the click
>does not take me to the above sub.
>
>Do you know how to fix this?
>
>Thanks,
>
>Burak
>.
>BK Guest



Reply With Quote

