CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 5/27/2004 3:43:23 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 87 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
jgn1013
Asp.Net User
Dynamic control post back value5/27/2004 3:43:23 AM

0/0

*** edited by: master4eva ***
Please enclose your code in < code ></ code> tags (without the spaces). This will make your code easier to read online; therefore, encouraging a response to be faster. It is to your own benefit for your question to be answered in future.

I have already done the editing to include the < code ></ code> tags for this post.
*********


I'm builidng a dynamic page with server controls inside a table based on data from sql table.

While myReader.Read()
Dim lbl2 As Label = New Label
lbl2.ID = "lbl2" & myReader1.GetString(3)
lbl2.Text = myReader1.GetString(4)

Dim txtbx1 As TextBox = New TextBox
txtbx1.ID = myReader1.GetString(3) & "yr"
txtbx1.MaxLength = 2
txtbx1.Width = Unit.Pixel(35)

Dim txtbx2 As TextBox = New TextBox
txtbx2.ID = myReader1.GetString(3) & "mo"
txtbx2.MaxLength = 2
txtbx2.Width = Unit.Pixel(35)
form1.Controls.Add(New LiteralControl("<Table border='0' cellpadding='0' width='90%'>"))
form1.Controls.Add(New LiteralControl("<tr>"))
form1.Controls.Add(New LiteralControl("<td width='30%' align='right'>"))
form1.Controls.Add(lbl2)
lbl2.Text = Session.Contents("skillcode" & myReader1.GetString(3))
form1.Controls.Add(New LiteralControl("</td>"))

form1.Controls.Add(New LiteralControl("<td width='14%' align='center'>"))
form1.Controls.Add(txtbx1)
******************HERE IS WHERE I WOULD LIKE TO GET VALUE FROM TXTBX AND ASSIGN TO SESSION STATE ***********************************************
Session.Contents(myReader1.GetString(3) & "yr") = txtbx1.Text
form1.Controls.Add(New LiteralControl("/"))
form1.Controls.Add(txtbx2)
Session.Contents(txtbx2.ID.ToString)= txtbx2.Text
form1.Controls.Add(New LiteralControl("</td>"))
form1.contorls.add(new LiteralContorl("</table>))
end while

When the page loads it will look somthing like this:
<body>
<table width="90%">
<td width='30%' align='right'>
<span id="lbl210KEY">10-Key</span></td>
<td width='14%' align='center'><input name="txtbx110KEYyr" type="text" maxlength="2" id="txtbx110KEYyr" style="width:35px;" />/<input name="txtbx210KEYmo" type="text" maxlength="2" id="txtbx210KEYmo" style="width:35px;" /></td>
<td width='2%' align='right'></td>
<td width='30%' align='right'>
<span id="lbl2AAAAA">AAA Acct </span></td>
<td width='14%' align='center'>
<input name="txtbx1AAAAAyr" type="text" maxlength="2" id="txtbx1AAAAAyr" style="width:35px;" />/<input name="txtbx2AAAAAmo" type="text" maxlength="2" id="txtbx2AAAAAmo" style="width:35px;" /></td>
<tr>
</table>

I would like to assign session.contents value to the data in the textbox. I know I have to rebuild the controls and do something with viewstate but i'm not sure how.

I'm guessing another way is to do literal/placeholder...any help would be greatly appreciated.
jgn1013
Asp.Net User
Re: Dynamic control post back value5/28/2004 4:17:36 PM

0/0

Please nobody has any suggestions on how i should do this? If what I have is not clear please let me know.

basically i'm looping through getting data and inserting them in specific cells.

*****************************
* lable 1 *txtbox / txbox2 *
*****************************
* lable 2*txtbox3 / txtbox4 *
*****************************

********
*submit *
********
so on............ once the form is built, user will enter value int the textbox, click submit, and data within txtbox will be inserted into db.


I'm really at a lost here and need some quick help.

TIA
master4eva
Asp.Net User
Re: Dynamic control post back value5/29/2004 7:46:27 AM

0/0

One thing that I am confused about: why don't you use the DataGrid control while in multiple edit mode? I am a bit short on time today but here is a good article on how to get the DataGrid into multiple edit mode:

http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchtopquestionsaboutaspnetdatagridservercontrol.asp?frame=true#vbtchtopquestionsaboutaspnetdatagridservercontroleditingmultiplerows
-- Justin Lovell
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Building a Web 2.0 Portal with ASP.NET 3.5: None Authors: Omar AL Zabir, Pages: 308, Published: 2007
Developing Killer Web Apps with Dreamweaver MX and C# Authors: Chuck White, Pages: 409, Published: 2004
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Developing and Implementing Web Applications with Visual Basic .NET and Visual Studio .NET: Exam Cram 2, 70-305 Authors: Kirk Hausman, Mike Gunderloy, Ed Tittel, Pages: 624, Published: 2003
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
ASP.NET 2.0 Web Parts in Action: Building Dynamic Web Portals Authors: Darren Neimke, Pages: 324, Published: 2007

Web:
ASP.NET.4GuysFromRolla.com: Dynamic Web Controls, Postbacks, and ... Sep 29, 2004 ... Failure to explicitly add the controls on each postback will cause the ..... Employee Then 'Read the dynamic controls' values and update the ...
Getting Dynamic Control Values on Postback with findControl Method ... Hello experts, My problem: I need to get values from dynamically created controls with in a master page in the load section of my code using the findcontrol ...
ImageUrl lost on postback with dynamic controls, but textboxes ... I am rebuilding each control on Postback and they show up fine. ... in a hidden value, then use that value on postback to define the ImageUrl of the image. ...
Getting value from dynamic controls postback problem - .NET C# Getting value from dynamic controls postback problem. ... but if i call the control creation with if !=postback then the controls ...
Dynamic Rating System Part 2: Postback :: DotNetJohn Mar 10, 2005 ... This article will focus on adding postback functionality to the control. Postback functionality is added by implementing the ...
How to get value from dynamic control on Post-back - ASP.NET Forums How to get value from dynamic control on Post-back. Last post 08-24-2007 12:54 PM by BHendry. 6 replies. Sort Posts: ...
ViewState and Dynamic Control NET tries to restore a ViewState value to a control, no control or a ..... 1. postback dynamic control creation - selectedindex by default points to zero ...
aspnet buildingcontrols Accessing Textbox Text After Postback in ... I change the value to be "Modified text" and click submit. ... this is a dynamic control so the control is first loaded on a postback and ...
Dynamic controls - Adding & Retrieving value in what Event should I retrieve the value of a dynamic control on postback. I've found that adding dynamic controls in the Page Load event ...
determining dynamic checkbox control's Checked value Feb 17, 2008 ... determining dynamic checkbox control's Checked value ... the underlying probem is that a browser will not postback a disabled fields. ...

Videos:
Looming City Bankruptcy?; Online Searching Risks; Public Square: Minimum Wage What is the prognosis for San Diego's troubled financial future? City officials and residents alike are looking for answers. Days after news that San...
XML11: An Abstract Windowing Protocol Google TechTalks June 1, 2006 Arno Puder Arno Puder received his masters and Ph.D. in computer science and is currently working as an Assistant Prof...
Xinjiang – Securing China’s Second Shore 3-D GIS Geovisual Michael Patrick, UW Dept. of Geography The Xinjiang Uygur Autonomous Region is arguably the remotest province of China, sparsely populated, land...
Beyond formalism: The art and science of designing pliant systems Google TechTalks March 10, 2006 Austin Henderson Abstract: The past decades have seen huge improvements in computer systems but these have proved d...
Charlie Rose - Interest Rates unchanged / Ray Kelly, NYC Police Commissioner Segment 1: A discussion about the Federal Reserve's decision not to raise interest rates with Ethan Harris, Chief Economist at Lehman Brothers and Ji...
MANIPULATION_VHS.wmv Greenhouse Affect vimeo "Manipulation" and WHITE BLACK THANG continue to edge out Weezer's Pork and beans as the internet's biggest songs....Most wa...
Charlie Rose - Bush's Iraq Strategy / Richard Clarke / Niki Caro Segment 1: David Sanger of The New York Times and Thomas DeFrank of the New York Daily News discuss President Bush's speech on his strategy for victo...
Hamza Yusuf - Tackling Extremism - Doha Debates The issue of how to combat extremism and improve relations between the West and Muslim world was the topic of the second Doha Debates Special on Febr...
www.moldytoaster.com ked as spam 0 Good comment Poor comment Reply 9. The last supper was symbolic. Now your arguments are just getting plain lazy and sloppy. 10. Laugh...
Charlie Rose - Vali Nasr / Sen. Byron Dorgan Segment 1: Vali Nasr discusses his new book, "The Shia Revival" and the current struggles taking place within Islam in the Middle East. Segment 2:...




Search This Site:










version 2 - filldataset method bug

asp.net configuration

security problem :/ (kind of) but it led to someone defacing one of my sites.

an asp.net question about creating a new module from existing source but no project file, and module already added to dnn app...

best blog module for dnn 2.1.2

trying to install dnn 4 on godaddy (with framework v2)

code coverage

looking for search module

about database name

install error

time zones. again. sorry. but...

dnn 1.2.1, msde - upgrade error

where to put a graphic for a custom module?

where is the master page designer?

where is the web service's project file?

getting value from formsauthentication?

call a class from a base class project within the same solution

export template problem

disabling postback in a asp menu with vs2008 and net 3.5

changing the default dev environment after install

forum sorting problems

preview for people without page admin rights

administrator permissions problem

correct namespace in 3.1.1

why isnt c# code invoked?

forcing the user to go the the default.aspx page first

treeview: how to add children under different roots?

can not login ..

upgrading error from dnn3.0.1 to 3.1.1

tree view control in share point portal server 2003 web part infastructure

 
All Times Are GMT