Jump to content
Xtreme .Net Talk

vbFace

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

vbFace's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. The scope of the project is a multi-page questionnaire. I will have to look into the data repeater control...
  2. If I want to dynamically add table columns/rows to an HTML table, will I have to incorporate Response.Write("<TR>") and similar .Writes in the code section to build it? I am not sure how to do this. EDIT: Oh, are you saying abandon the use of the PlaceHolder and dynamically load the controls into the dynamcially created table rows?
  3. Yes, I am putting all of the like-objects into a placeholder in one table cell. I wouldn't know where to start to mix the creation of dynamic controls with the creation of dynamic table rows.... :( That's what you guys are for! :) Seriously, I could use help on that. This is the code that I have for the page: Sub Page_Load Dim oConn as OleDbConnection dim oComm as OleDbCommand Dim Reader as OleDbDataReader Dim SQL as String Dim i as Integer oConn = MyConn.GetConnection() SQL = "SELECT ParentQuestions.QParentText, Questions.QNum, Questions.LabelText, ControlText.ControlText " SQL = SQL & "FROM (ParentQuestions INNER JOIN Questions ON ParentQuestions.QParentNum = Questions.QParentNum) INNER JOIN ControlText ON Questions.ControlTextID = ControlText.ControlTextID " SQL = SQL & "WHERE ParentQuestions.QParentNum = 1;" oComm = New OleDbCommand(SQL, oConn) Reader = oComm.ExecuteReader() i = 1 While Reader.Read() AddControls(i,Reader("Qnum"),Reader("LabelText")) End While End Sub Sub AddControls(Index as Integer, QNum as Long, LabelText as String) Dim myLabel as Label Dim myRadio as RadioButtonList Dim myRFV as RequiredFieldValidator Dim myText as TextBox Dim myUnits as System.Web.UI.WebControls.Unit ' Add Label myLabel = new Label myLabel.ID = "LabelQ" & QNum myLabel.Text = LabelText & "<br><br>" myLabel.BorderStyle = 2 plhLabels.Controls.Add(myLabel) ' Add Radio myRadio = new RadioButtonList myRadio.ID = "RadioQ" & Qnum myRadio.Items.Add("0") myRadio.Items.Add("1") myRadio.Items.Add("2") myRadio.Items.Add("3") myRadio.Items.Add("4") myRadio.Items.Add("5") myUnits = new System.Web.UI.WebControls.Unit(402) myRadio.Width = myUnits myRadio.RepeatDirection = 0 plhRadios.Controls.Add(myRadio) ' Add RFV myRFV = new RequiredFieldValidator myRFV.ID = "RFVQ" & QNum myRFV.ErrorMessage = "Unanswered" myRFV.ControlToValidate = "RadioQ" & Qnum plhRFVs.Controls.Add(myRFV) End Sub <table class="MyText" height="1000" cellspacing="0" cellpadding="1" width="800" bgcolor="white" border="0"> <tbody> <tr> <td valign="top" width="800" colspan="9" height="75"> <!--#include file="include/header.inc"--></td> </tr> <tr> <td class="QText" valign="top" width="800" colspan="9" height="50"> <br /> <asp:Label id="lblQParent" runat="server" cssclass="MyText" font-bold="True" forecolor="Blue">Please indicate the degree to which the following companies provide "value for the cost of their services."</asp:Label></td> </tr> <tr> <td valign="bottom" width="200" height="25"> </td> <td valign="bottom" align="left" width="67" height="25"> <font color="black"><u>No</u> <br /> <u>Opinion</u> </font></td> <td valign="bottom" align="left" width="67" height="25"> <font color="black"><u>Low </u> <br /> <u>Value</u></font> </td> <td valign="bottom" width="67" colspan="1" height="25"> <font color="black"><u>High </u> <br /> <u>Value</u></font> </td> <td width="198" colspan="2"> </td> </tr> <tr bgcolor="#e0e0e0"> <td valign="center" align="left" width="200" height="25"> <asp:PlaceHolder id="plhLabels" runat="server"></asp:PlaceHolder> </td> <td valign="center" width="402" colspan="6" height="25"> <asp:PlaceHolder id="plhRadios" runat="server"></asp:PlaceHolder> </td> <td valign="center" width="100"> <asp:PlaceHolder id="plhRFVs" runat="server"></asp:PlaceHolder> </td> <td valign="center" width="100"> <asp:PlaceHolder id="plhQNums" runat="server"></asp:PlaceHolder> </td> </tr> <tr> <td valign="center" width="200" height="25"> </td> <td valign="top" width="402" colspan="6" height="25"> </td> </tr> <tr> <td colspan="9" height="25"> </td> </tr> <tr> <td valign="bottom" align="middle" width="800" colspan="9" height="25"> <asp:Button id="btnContinue" onclick="btnContinue_Click" runat="server" Text="Continue"></asp:Button> </td> </tr> <tr> <td valign="bottom" width="800" colspan="9"> <!--#include file="include/footer.inc"--></td> </tr> </tbody> </table>
  4. I am attempting a dynamic web form. I have a table with 4 columns. In each column is a PlaceHolder object. It goes like this: Column1 Column2 Column3 Column4 ------------------------------------------------------------ Labels RadioBtnLists ReqFldValidators TextBoxes When I dynamically create a Label control, I set the properties like this: myLabel = new Label myLabel.ID = "LabelQ" & QNum '<--- Passed Long myLabel.Text = LabelText myLabel.BorderStyle = 2 plhLabels.Controls.Add(myLabel) ' Add to the Labels' PlaceHolder The problem is that the labels all bunch up and continue left-to-right as wide as the table detail (< td >). I tried to add & "< br >< br >" to the myLabel.Text property. It DOES separate the labels, but not exactly in a way that I can control the spacing with the objects in the rest of the Table Row. It is only the text of the control. Its odd. I am trying to find out how to properly align controls inside the PlaceHolder Object.
  5. If I wanted to use SQL Server 2000 to host the DB for an ASP.NET app with, say, 50 - 100 people accessing the ASP.NET app at one time, do I need to buy user licenses for 100 people? Or, since in ASP you open a connection, use it, then close it, is a 25-user license sufficient? I need to know "how much" SQL Server I need!
  6. Robby, what do you use on that site that acts like HTML frames?
  7. WOW! This is fantastic! I can now make a page where a user can enlarge/lessen text size within the page. Nice!
  8. Anyone know if ASP.NET frames lead to the same search engine problems with regular frames? Because I hear that frames on a page keep the "content" page's keywords from being found by search engines.
  9. Sounds like the orig. example is a pseudo-pointer in php. No pointers in VB.NET I believe.
  10. Maybe use a session variable with the name of the control that needs to focus, and then read that back after the postback?
  11. vbFace

    Classes

    To expand on his inquiry, if you have classes in a DLL and public variables in that DLL, you said the classes have separate referrers. What about the DLL? Will it be loaded into the server's memory only once, and server up private refers of classes to all users - also making public variables public to all users?
  12. Try changing: Response.Redirect("/Security/SecurityMain.aspx") to Response.Redirect("Security/SecurityMain.aspx")
  13. Oh, cool. I guess only if I need to write to the HTML stream from a VB/C# code section, then I need Response.Write. That is nice to know!
  14. You could also save Page A's info in the Session Object, although if the number of data items is large, it could be a mess. You CAN create a class/DLL in C# and assign that class to the Session object. Check out this thread: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=81560 Then, you can just use Response.Redirect("PageA.aspx") to navigate without querystrings. Basically, it would depend on the number of data items.
  15. Because I really don't know what I am doing yet! :) Also, I thought that ASP.NET won't handle straight JavaScript when it serves up the resulting ASP.NET page in HTML format, so it must be written with Response.Write. Am I wrong?
×
×
  • Create New...