Click here to Skip to main content
15,895,142 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: can't refresh master page's function when called from another page dynamically. Pin
himanshu256115-Jun-09 19:45
himanshu256115-Jun-09 19:45 
GeneralRe: can't refresh master page's function when called from another page dynamically. Pin
pujafaldu15-Jun-09 19:54
pujafaldu15-Jun-09 19:54 
GeneralRe: can't refresh master page's function when called from another page dynamically. Pin
himanshu256115-Jun-09 20:05
himanshu256115-Jun-09 20:05 
GeneralRe: can't refresh master page's function when called from another page dynamically. Pin
pujafaldu15-Jun-09 20:30
pujafaldu15-Jun-09 20:30 
Questiongetting value of dynamic textbox after post back Pin
Saam_cse15-Jun-09 2:48
Saam_cse15-Jun-09 2:48 
AnswerRe: getting value of dynamic textbox after post back Pin
himanshu256115-Jun-09 2:59
himanshu256115-Jun-09 2:59 
AnswerRe: getting value of dynamic textbox after post back Pin
Abhijit Jana15-Jun-09 3:01
professionalAbhijit Jana15-Jun-09 3:01 
AnswerRe: getting value of dynamic textbox after post back Pin
Kapil Thakur15-Jun-09 23:45
Kapil Thakur15-Jun-09 23:45 
Create a HashTable and add the control id as key and control value as value.
Then at postback get the control's value using Request.Form(control_id) and create the control again and assign it the same value.

Example :

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

            Try

                  If Not IsNothing(ViewState("ht")) Then

                        Dim v_ht As New Hashtable
                        v_ht = CType(ViewState("ht"), Hashtable)

                        For i As Integer = 0 To v_ht.Count - 1
                              'getting value of 1st control
                              Dim a = Request.Form("txt_1")
                              'getting value of 2nd control
                              Dim b = Request.Form("txt_2")
                        Next

                  Else

                        Dim ht As New Hashtable

                        'dynamically created 1st control
                        Dim txt As TextBox
                        txt = New TextBox
                        txt.ID = "txt_1"
                        txt.Text = "CODE"
                        ht.Add(txt.ID, txt.Text)
                        ph_Main.Controls.Add(txt)

                        'dynamically created 2nd control
                        txt = New TextBox
                        txt.ID = "txt_2"
                        txt.Text = "PROJECT"
                        ht.Add(txt.ID, txt.Text)
                        ViewState("ht") = ht

                        ph_Main.Controls.Add(txt)

                  End If

            Catch ex As Exception
                  Response.Write(ex.ToString)
            End Try

      End Sub


store the id(s) of dynamic controls in a hashtable.
at postback loop through the hashtable and using Request.Form and passing control id through hastabale , get back all values.

this is the easiest method of getting back the values of dynamically created controls.

Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com

AnswerRe: getting value of dynamic textbox after post back Pin
Matt Cavanagh15-Jun-09 23:59
Matt Cavanagh15-Jun-09 23:59 
Questionstruct with the problem of updation of carrer profile in my company website Pin
svenki15-Jun-09 2:37
svenki15-Jun-09 2:37 
JokeRe: struct with the problem of updation of carrer profile in my company website Pin
Manas Bhardwaj15-Jun-09 2:43
professionalManas Bhardwaj15-Jun-09 2:43 
AnswerRe: struct with the problem of updation of carrer profile in my company website Pin
Abhishek Sur15-Jun-09 2:46
professionalAbhishek Sur15-Jun-09 2:46 
Questiontype 'System.StackOverflowException' error while writing class file which i am inheriting Pin
anbusenthil15-Jun-09 2:31
anbusenthil15-Jun-09 2:31 
AnswerRe: type 'System.StackOverflowException' error while writing class file which i am inheriting Pin
Manas Bhardwaj15-Jun-09 2:41
professionalManas Bhardwaj15-Jun-09 2:41 
GeneralRe: type 'System.StackOverflowException' error while writing class file which i am inheriting Pin
anbusenthil15-Jun-09 2:52
anbusenthil15-Jun-09 2:52 
QuestionGetting HTML string of Panel in codebehind Pin
Milind R Chavan15-Jun-09 2:11
Milind R Chavan15-Jun-09 2:11 
AnswerRe: Getting HTML string of Panel in codebehind Pin
himanshu256115-Jun-09 2:19
himanshu256115-Jun-09 2:19 
GeneralRe: Getting HTML string of Panel in codebehind Pin
Milind R Chavan15-Jun-09 2:25
Milind R Chavan15-Jun-09 2:25 
AnswerRe: Getting HTML string of Panel in codebehind [modified] Pin
N a v a n e e t h15-Jun-09 2:29
N a v a n e e t h15-Jun-09 2:29 
GeneralRe: Getting HTML string of Panel in codebehind Pin
Milind R Chavan15-Jun-09 2:35
Milind R Chavan15-Jun-09 2:35 
GeneralRe: Getting HTML string of Panel in codebehind Pin
Milind R Chavan15-Jun-09 2:44
Milind R Chavan15-Jun-09 2:44 
GeneralRe: Getting HTML string of Panel in codebehind Pin
Baran M15-Jun-09 2:56
Baran M15-Jun-09 2:56 
Questionhow to paste an image in a text area Pin
gogal198315-Jun-09 1:32
gogal198315-Jun-09 1:32 
AnswerRe: how to paste an image in a text area Pin
Manas Bhardwaj15-Jun-09 2:11
professionalManas Bhardwaj15-Jun-09 2:11 
AnswerRe: how to paste an image in a text area Pin
N a v a n e e t h15-Jun-09 2:20
N a v a n e e t h15-Jun-09 2:20 

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.