Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAdding control and serverside script to page dynamically Pin
Fayu19-Jun-10 17:26
Fayu19-Jun-10 17:26 
AnswerRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 1:43
mentorNot Active20-Jun-10 1:43 
GeneralRe: Adding control and serverside script to page dynamically [modified] Pin
Fayu20-Jun-10 4:41
Fayu20-Jun-10 4:41 
GeneralRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 4:44
mentorNot Active20-Jun-10 4:44 
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 5:12
Fayu20-Jun-10 5:12 
GeneralRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 9:21
mentorNot Active20-Jun-10 9:21 
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 12:27
Fayu20-Jun-10 12:27 
AnswerRe: Adding control and serverside script to page dynamically Pin
NeverHeardOfMe20-Jun-10 4:01
NeverHeardOfMe20-Jun-10 4:01 
I think what you're trying to do is something along these lines (excuse my VB code - you'll have to trasnlate it yourself if you want)

First, add a placeholder control on the form where you want to add the new control, and also a literal (just so we can test things_ -eg:

<asp:PlaceHolder runat="server" ID="phHere"></asp:PlaceHolder>
<p><asp:Literal runat="server" ID="litClick"></asp:Literal></p>

Then in your code behind, add this:

Private Sub btnNewButton_Click(ByVal Sender As Object, ByVal e As EventArgs)
litClick.Text = "Clicked!"
End Sub

and in the Page_Load event, add this:

Dim btn As New Button
btn.ID = "btnNewButton"
btn.Text = "My new button"
AddHandler btn.Click, AddressOf btnNewButton_Click
phHere.Controls.Add(btn)
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 4:39
Fayu20-Jun-10 4:39 
QuestionLock down a web site's allowable IP range to just one IP address [modified] Pin
jpang00119-Jun-10 15:43
jpang00119-Jun-10 15:43 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld19-Jun-10 23:46
professionalDaveAuld19-Jun-10 23:46 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
jpang00120-Jun-10 3:35
jpang00120-Jun-10 3:35 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
Dimitri Witkowski20-Jun-10 3:57
Dimitri Witkowski20-Jun-10 3:57 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld20-Jun-10 4:20
professionalDaveAuld20-Jun-10 4:20 
Question.asp Pin
AndyInUK19-Jun-10 12:19
AndyInUK19-Jun-10 12:19 
AnswerRe: .asp Pin
NeverHeardOfMe19-Jun-10 13:25
NeverHeardOfMe19-Jun-10 13:25 
QuestionProcessing webpage post (automated) Pin
David Hovey19-Jun-10 11:27
David Hovey19-Jun-10 11:27 
QuestionGoogleMap as UserControl, using ModalPopup Pin
giantsover19-Jun-10 3:54
giantsover19-Jun-10 3:54 
AnswerRe: GoogleMap as UserControl, using ModalPopup Pin
DaveAuld19-Jun-10 6:40
professionalDaveAuld19-Jun-10 6:40 
GeneralRe: GoogleMap as UserControl, using ModalPopup Pin
giantsover19-Jun-10 8:24
giantsover19-Jun-10 8:24 
GeneralRe: GoogleMap as UserControl, using ModalPopup Pin
DaveAuld19-Jun-10 23:59
professionalDaveAuld19-Jun-10 23:59 
QuestionVisualisation of data table during debugging - function evaluation timeout Pin
ChrisFarrugia19-Jun-10 3:20
ChrisFarrugia19-Jun-10 3:20 
QuestionHyperlink Pin
farokhian19-Jun-10 2:26
farokhian19-Jun-10 2:26 
AnswerRe: Hyperlink Pin
Luc Pattyn19-Jun-10 2:58
sitebuilderLuc Pattyn19-Jun-10 2:58 
QuestionSession value in java script Pin
Amit Patel198519-Jun-10 0:52
Amit Patel198519-Jun-10 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.