G
Guest
Im confused
I want an .aspx page to have a table with my data in it. At first I wrote FillTablew(); in my Page_Load even in the Code Behind file. I had it loop the db etc. and use Response.Write of a bunch of strings. This works great as long as all I want is the results of those Response.Writes
I believe what I REALLY want is to convert those Response.Writes to a str cat in the code behind, and then in the body of my .aspx page to do something like.... <% Label.Text = FillTable() %> . This way I get the table inside the HTML so I can do other things on the page
I couldn't get that to work so I did the Label.Text = GetTable(); from the Page_Load of the Code behind instead
What SHOULD I have done? The response.write executes before html, so it ends up above my html page when the client sees it, so I think that is out. What I don't get is.... is the ONLY way to get the results of a function in code behind back to the .aspx page on screen to make it the result of a text property ? If this is so, is this desirable? If it is, how do I do it without using the Page_Load function? OR... am I suppose to use it that way
I've been looking it up, but I can only find examples that replace the name of a submit button and the like. I guess what I'm looking for is best practice for returning what will be a bunch of HTML code to the ASPX page from c# code behind
thanks !!!!!!!!!
I want an .aspx page to have a table with my data in it. At first I wrote FillTablew(); in my Page_Load even in the Code Behind file. I had it loop the db etc. and use Response.Write of a bunch of strings. This works great as long as all I want is the results of those Response.Writes
I believe what I REALLY want is to convert those Response.Writes to a str cat in the code behind, and then in the body of my .aspx page to do something like.... <% Label.Text = FillTable() %> . This way I get the table inside the HTML so I can do other things on the page
I couldn't get that to work so I did the Label.Text = GetTable(); from the Page_Load of the Code behind instead
What SHOULD I have done? The response.write executes before html, so it ends up above my html page when the client sees it, so I think that is out. What I don't get is.... is the ONLY way to get the results of a function in code behind back to the .aspx page on screen to make it the result of a text property ? If this is so, is this desirable? If it is, how do I do it without using the Page_Load function? OR... am I suppose to use it that way
I've been looking it up, but I can only find examples that replace the name of a submit button and the like. I guess what I'm looking for is best practice for returning what will be a bunch of HTML code to the ASPX page from c# code behind
thanks !!!!!!!!!