
wsyeager
Avatar/Signature-
Posts
140 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by wsyeager
-
Actually, it's line 302.....
-
Attached, you will find the neccessary files for the problem. The code in question is inside the "GetAssessmentText" function on line 282 within the exam.aspx.vb file. If you need any further info, please feel free to let me know. PlacementTests.zip
-
Stylesheet form problem It's sent to the browser via the "View Source" from Intgernet Explorer. It's too deep already to change everything else around. I have to use the stylesheets.
-
StyleSheet form question In other words, how can I reference the form names from my code-behind in place of Request.Form(arrLineDetail(3)) I know this will need to be Javascript form items that I will need to reference from my code-behind, b ut I don't know the proper syntax.
-
I took over doing another webform in ASP.Net 2.0 from a fellow co-worker, and have the following setup: I have 20 StyleSheet questions as presented in the following format: 1) Evaluate the variable expression x + y - z when: x = 783, y = 472, z = 322 A) 11 B) 633 C) 933 D) 1577 E) Unsure how to solve Corresponding form names to the above code: (document.EXAM.Q1[0].checked) (document.EXAM.Q1[1].checked) (document.EXAM.Q1[2].checked) (document.EXAM.Q1[3].checked) (document.EXAM.Q1[4].checked Corresponding HTML for the above: <span class="questionText">1) Evaluate the variable expression x + y - z when: x = 783, y = 472, z = 322</span> <br /> <input type="radio" name="Q1" value="A"> <span class="questionText">A) 11</span> </input> <br /> <input type="radio" name="Q1" value="B"> <span class="questionText">B) 633</span> </input> <br /> <input type="radio" name="Q1" value="C"> <span class="questionText">C) 933</span> </input> <br /> <input type="radio" name="Q1" value="D"> <span class="questionText">D) 1577</span> </input> <br /> <input type="radio" name="Q1" value="E"> <span class="questionText">E) Unsure how to solve</span> </input> The previous developer had the following code which never worked to try and find a value that the user put in for the question: strQuery = "/*/section[@name='" & arrLineDetail(0) & "']/question[@label='" & arrLineDetail(1) & "']/option[@value='" & Request.Form(arrLineDetail(3)) & "']" When debugging, this value (Request.Form(arrLineDetail(3)) ) is set to NOTHING. For each question, the developer had cycled thru trying to get the answers the user put in. How can I retrieve the values from the form? I know what arrLineDetail means, so don't worrry about that. Don't forget, this stylesheet is not within a form tag....
-
Can't get a property from a user control The Repeater control is inside the UserControl. My aspx page hosts the UserControl. I tried setting a break point in the PageLoad event of the aspx page (which is where I wanted to get my property value), but the PageLoad event of the aspx page was never hit... I don't get it. I thought that the UserControl gets rendered first, then the aspx page which hosts it. All I want to do is to access a property inside the UserControl from my aspx page....
-
I have a public property inside my usercontrol which I set inside the Repeater.ItemDataBound event as follows: <code> If blnFirstTime Then Dim lblstrDate As Label = DirectCast(e.Item.FindControl("lblPressReleaseDate"), Label) blnFirstTime = False strDate = lblstrDate.Text End If </code> After the user control finishes databinding, I want to take the value of this property and display it on the aspx page that is hosting the usercontrol. I have the following set up: <code> Protected PressRoomArticles As New Platform_CampusInfo_PressRoom_UserControls_PressRoomArticles </code> I have the following code set up to retrieve the value, but I don't know what event of the page to place it in. <code> lblPressDate.Text = PressRoomArticles.sPressReleaseDate 'this is my public property inside the user control </code> What event can I use to display the value of this variable? fyi, this value is coming up as a label text value inside the user control when displayed. Since it's a repeater, I set the visibility to disabled, since I only want it displayed once on the aspx page that hosts this user control.
-
Merging data between an Untyped and Typed Dataset
wsyeager replied to wsyeager's topic in Database / XML / Reporting
Possible solution The only thing I can think of that would accomplish this is the following code: <code> Dim dr As DataRow For Each dr In dst.Tables(0).Rows DstCustomers1.Customers.ImportRow(dr) Next </code> If anyone has anything more efficient, just let me know.... -
Does anybody know how you can merge data from an Untyped Dataset into a specific table of a Strongly Typed Dataset? Check out the following function: <code> Public Function GetCustomerss() As dstCustomers Try Dim dst As New DataSet Dim tablenames() As String = {"Customers"} SqlHelper.FillDataset(SqlDataAdapter1.SelectCommand, dst, tablenames) DstCustomers1.Merge(dst) Catch ex As Exception Throw (ex) Finally SqlDataAdapter1.Dispose() SqlConnection1.Close() End Try Return DstCustomers1 End Function </code> Suppose that dataset "DstCustomers1" has two tables in it (Customers and Orders). When you perform the following code, <code> DstCustomers1.Merge(dst) </code> if 'DstCustomers1' has only one table, it will perform the merge with no problem. However, how can you specifically merge the contents of the Untyped dataset into a specific table of DstCustomers1 (like into the Customers or Orders table)?
-
I'm trying to create a user control which will act as a menu list for users to click on. All the user control consists of is a panel, a table within the panel, 1 tablerow and multiple table cells for a horizontal look. However, the tablecells inside the usercontrol cannot be found ("Object not set to an instance of an object"). If I implement the same code within the page itself, without the usercontrol, it works fine. Here is my html: <code> <asp:Panel Runat="server" id="Panel1" style="Z-INDEX: 108; LEFT: 8px; POSITION: absolute; TOP: 48px"> <asp:table id="Table2" runat="server" Font-Bold="True" Font-Size="X-Small"> <asp:TableRow Visible="False" ID="trMain"> <asp:TableCell Visible="False" ID="tcAdmin"> <asp:HyperLink runat="server" NavigateUrl="../Admin/Admin.aspx">Administration</asp:HyperLink> </asp:TableCell> . . . </code> Here is my code behind in the user control: <code> Public Sub LoadMenu() Try Dim blnFound As Boolean Dim tcAdmin As TableCell = DirectCast(FindControl("tcAdmin"), TableCell) </code> Here is my code in the code behind for the parent aspx page: <code> Protected MenuItems As New RMS2.MenuItems . . . MenuItems.LoadMenu() </code> When debugging inside the usercontrol, the tcAdmin variable has a value of Nothing. How can I get this variable inside the user control to be recognized?
-
Thanks --- that worked.......
-
I have the following code that places some text for a specific day on the Calendar control: <code> strNewDescription = ControlChars.NewLine & strNewDescription Dim lblTimeOffDay As Label = New Label lblTimeOffDay.Text = strNewDescription e.Cell.Controls.Add(lblTimeOffDay) </code> However, I would like the text to begin on a new line UNDERNEATH the day number shown in the calendar. So, instead of having something like this: 14 abc I would like it to read like this: 14 abc I tried placing the ControlChars.NewLine and ControlChars.CrLf and also "\n" to the beginning of the description, but it still comes out like : 14 abc Does anyone know how I can start the label underneath the day of the month?
-
I have a webform with two listboxes. One is the parent and the other one is the child (meaning the child listbox gets populated depending on what is selected in the parent listbox). I have one dataset that has four related datatables in it. This data gets loaded during the Page_Load event. The child table in question, has 7 records in it, of which I need to filter out a smaller subset. I tried using the DataView, which was successfull, but I needed to save this filtered data across postbacks, and you can't save a dataview in session state because it's not serializable. So, I made a copy of the original dataset, and copied just the filtered data over and then placed the dataset in session state. I then databind the child listbox with the child data. When I click on a Submit button, this starts the postback process. In the Page_Load event during the postback, I databind the child listbox to the specific datatable within the dataset I placed in session state which works fine. Right before the end of the Page_load event, I check the number of rows in my child datatable in session state which has 5 rows. As soon as I step to the next line of code (which is inside the button handler), I check the session state of that same exact child datatable and it contains 0 rows. The session state variable is still there, but it contains 0 rows. There is no other code between the last line of code of the Page_Load event and the first line of the event handler (for the button). Does anyone know why my child datatable would contain 5 rows during the last statement of my Page_Load event and the next line of code within the event handler all of a sudden has 0 rows? It's really puzzling me??? btw, the datasource and datamember for the listboxes are set at design time...
-
JavaScript question... I copied and pasted your exact code into mine, and it still doesn't work... Something is obviously being hosed up on my end. MS should have a much easier way to implement JS into your code and it should have a way to debug your JS as well. I just can't figure out where the problem is happening. I even tried changing the code to the following: <code> Private Sub RegisterStartUpScripts() txtDetailedDescr.Attributes.Add("onBlur", "change_class();") If (Not IsClientScriptBlockRegistered("PageStartupJScript")) Then RegisterClientScriptBlock("PageStartupJScript", "<script language=""javascript"" src=""~/ClientFunctions.js""></script>") End If End Sub </code> The JS code in my ClientFunctions.js file is as follows: <code> function change_class() { if document.getElementById("lbtnUpdateDoc").className == "normal" { document.getElementById("lbtnUpdateDoc").className = "bold"; } } </code> The above still doesn't work as well. The thing that puzzles me, is that I've done this type of stuff before without too much of a problem. For some reason, it just is hosing up now.... Thanks for your patience and help in this matter. If you have any other solutions, feel free to share them with me, especially to see if the javascript function is even being rendered and if it is properly executing....
-
The styles do exist as outlined in the below code: <code> .bold { font-weight:bold; } .normal { font-weight:normal; } </code> The stylesheet and the page I'm trying to get the script to work with are both on the root level of the web app as follows: <code> <LINK href="Styles.css" type="text/css" rel="stylesheet"> </code> I have the following js when registering my scripts: <code> Dim strScript As String = "<script language='javascript'>" & _ "function change_class() " & _ "{if document.getElementById('lbtnUpdateDoc').className == 'normal'" & _ "{ document.getElementById('lbtnUpdateDoc').className = 'bold';}" & _ "}" & _ "</script>" txtDetailedDescr.Attributes.Add("onBlur", "change_class();") Page.RegisterStartupScript("Bold", strScript) </code> All of this seems to check out with me.... I've registered javascripts in other apps with a separate file (which for some reason isn't working in this app - that's why I'm creating the script somewhat inline). If you could tell me anything of waht's wrong with the way I'm doing it, I'd much appreciate it. I just think I'm trying to jump thru hoops just for some simple javascripts to be done. I think MS should have come up with a simpler way to incorporate JS into code without making a mountain out of a mole hill... Thanks in advance....
-
I got it now... After browsing to the file with the input control, I then use a linkbutton to actually add the document to a collection and eventually add it to SQL Server as follows: <code> Dim filecontrol As HtmlControls.HtmlInputFile filecontrol = DirectCast(Me.FindControl("ffRequestDoc"), HtmlControls.HtmlInputFile) Dim txtDetailedDescr As TextBox = DirectCast(Me.FindControl("txtDetailedDescr"), TextBox) Dim sr As New StreamReader(filecontrol.PostedFile.InputStream) . . . 'Add attachments to collection Dim drAttachments As dstRequests.AttachmentsRow = DstRequests1.Attachments.NewAttachmentsRow drAttachments.AttachmentName = strAttachmentName drAttachments.AttachmentDescription = txtDetailedDescr.Text.Trim drAttachments.FileType = filecontrol.PostedFile.ContentType drAttachments.PathName = filecontrol.PostedFile.FileName drAttachments.FileLength = filecontrol.PostedFile.ContentLength drAttachments.UserLastModified = HttpContext.Current.User.Identity.Name drAttachments.DateLastModified = Convert.ToDateTime(ViewState.Item("PresentDate")) Dim content() As [byte] = New Byte(filecontrol.PostedFile.ContentLength) {} drAttachments.FileData = content DstRequests1.Attachments.AddAttachmentsRow(drAttachments) </code> I know there is a way in the web.config file to increase the size limit of the file attachment. Do you happen to know what it is? Thanks much.......
-
What you said makes perfect sense... I tried to implement the code as follows: <code> Dim strScript As String = "<script language='javascript'>" & _ "function change_class('lbtnUpdateDoc') " & _ "{if document.getElementById('lbtnUpdateDoc').className = 'normal'" & _ "{ document.getElementById('lbtnUpdateDoc').className = 'bold';}" & _ "}" & _ "</script>" txtDetailedDescr.Attributes.Add("onBlur", "change_class('lbtnUpdateDoc');") Page.RegisterStartupScript("Bold", strScript) </code> However, the script is still not working. It's not changing to boldface when I type in the textbox named (txtDetailedDescr). What am i doing wrong?
-
I've tried implementing the code you supplied, but this just reads data inside the actual file being uploaded. I just want to get the pathname of the file? I'm using the following code: <code> Dim filecontrol As HtmlControls.HtmlInputFile filecontrol = DirectCast(Me.FindControl("ffRequestDoc"), HtmlControls.HtmlInputFile) Dim strReqFrmDoc As String = filecontrol.PostedFile.FileName </code> However, like I said before, it's giving me problems accessing the correct path when I access my app from a web server other than my local machine. How can I resolve this?
-
I've placed the following javascript inside the page as follows: <code> Dim strScript As String = "<script language='javascript'>" & _ "document.getElementById('lbtnUpdateDoc').className = 'normal';" & _ "</script>" Dim strScript2 As String = "<script language='javascript'>" & _ "if document.getElementById('lbtnUpdateDoc').className = 'normal'" & _ "{ document.getElementById('lbtnUpdateDoc').className = 'bold';}" & _ "</script>" txtDetailedDescr.Attributes.Add("onBlur", strScript2) Page.RegisterStartupScript("Normal", strScript) Page.RegisterStartupScript("Bold", strScript2) </code> I want to boldface a link when the user starts typing in a textbox. However, when I go into the webpage, and start typing, the link doesn't change to bold. I tried the following code, but as soon as I get into the webpage, the link is already boldfaced. It doesn't even wait until I start typing into the textbox. <code> Dim strScript2 As String = "<script language='javascript'>" & _ "document.getElementById('lbtnUpdateDoc').className = 'normal'" & _ "</script>" txtDetailedDescr.Attributes.Add("onBlur", strScript2) Page.RegisterStartupScript("Bold", strScript2) </code> Do you know off-hand, what I might be doing wrong? In addition, how would you debug javascript from within VS.Net?
-
I'm using the HTML "FileField" control to browse to a file. Once it's selected, I then use a linkbutton to try and upload the file to the app. This works fine if the webserver is local to my machine. However, once the app is on another webserver instead of my local machine, it can't find the file. I tried putting a file on our development web server to access. When I browse to the exact same filename on my local machine, it finds the file only because it exists on the webserver. This means that the "Browse" button of the control is looking on the webserver, not the users' local machine. Therefore, how do I update the pathname of the file to get the correct file from the users' machine and not the webserver?
-
Ok, I give up... I've scoured the internet to try and find an example of this, but can't seem to find one. All I want to do is to retrieve the path of a filename. I'm using the HtmlControls.HtmlInputFile control to browse to a file. Once the pathname is in the textbox portion of the control, I then use a linkbutton to actually retrieve the file (based on the pathname in the control). <code> Dim filecontrol As HtmlControls.HtmlInputFile filecontrol = DirectCast(Me.FindControl("ffRequestDoc"), HtmlControls.HtmlInputFile) </code> This works fine if I'm testing on my local machine and the file exists on my local machine. However, I now have the app on another test webserver and when I try and get the pathname of the file, it throws an error saying it can't find the file. Now, I know, it's because the pathname is no longer an absolute path. The question is, how do I get the proper pathname in order to get the file?
-
I should have realized that about the difference in the server-side vs the client-side functions. I changed the code-behind to the following: <code> lbtnClearAttachmentDescr.Attributes.Add("onClick", "ClearAttachmentDescr();") txtDetailedDescr.Attributes.Add("onBlur", "BoldUpdateDoc(txtDetailedDescr.value);") If (Not IsClientScriptBlockRegistered("PageStartupJScript")) Then RegisterClientScriptBlock("PageStartupJScript", "<script language=""javascript"" src=""ClientFunctions.js""></script>") End If </code> I changed the html to the following: <code> <asp:textbox id="txtDetailedDescr" style="Z-INDEX: 104; LEFT: 8px; POSITION: absolute; TOP: 64px" tabIndex="10" runat="server" Height="36px" Width="488px" MaxLength="255" TextMode="MultiLine"></asp:textbox> </code> I don't get an error on the page, but the functionality isn't working. The textbox is not getting clear out (when I click on the lbtnClearAttachmentDescr linkbutton) and the text is not being boldfaced for the other (when I change the text for the txtDetailedDescr textbox). As a matter of fact, the clearing out of the textbox still thinks it's server side, because when I view the source, I see the following for lbtnClearAttachmentDescr: onClick="ClearAttachmentDescr();" href="javascript:__doPostBack('lbtnClearAttachmentDescr','')" What am I still doing wrong???
-
I'm getting this error when I try and get to the web page: 'BoldUpdateDoc' is not a member of 'ASP.Request_aspx' ASPX: <code> <asp:textbox id="txtDetailedDescr" style="Z-INDEX: 104; LEFT: 8px; POSITION: absolute; TOP: 64px" tabIndex="10" runat="server" Height="36px" Width="488px" MaxLength="255" TextMode="MultiLine" OnTextChanged="BoldUpdateDoc(txtDetailedDescr.value);"></asp:textbox> </code> CODE-BEHIND: <code> lbtnClearAttachmentDescr.Attributes.Add("onClick", "ClearAttachmentDescr();") txtDetailedDescr.Attributes.Add("OnTextChanged", "BoldUpdateDoc();") If (Not IsClientScriptBlockRegistered("PageStartupJScript")) Then RegisterClientScriptBlock("PageStartupJScript", "<script language=""javascript"" src=""ClientFunctions.js""></script>") End If function BoldUpdateDoc(text){ document.getElementById("txtDetailedDescr")).innerHTML = '<b>' + text + '</b>'; } </code> Any idea what I'm doing wrong?
-
Does anyone know what the syntax is to boldface and highlight an object in a different color? I have the following javascript, but need to know the above to complete it: <code> function BoldUpdateDoc(){ var txt = document.getElementById("txtDetailedDescr"); } </code> Once I have a reference to the above object, I want to highlight it in a different color and boldface it... On a different note, I'm trying to clear out a field on a form if a user clicks a linkbutton. I have the following javascript for that: <code> function ClearAttachmentDescr(){ var txt = document.getElementById("txtDetailedDescr"); txt = '' } </code> However, when I try to set the onclick event in the html for the linkbutton to execute the above function, I get an error. I'm trying to prevent the control from executing the server-side postback when clicked, but can't seem to get it to work. If anybody can help me with the above scripts, I'd really appreciate it.
-
Could someone please tell me what the status code is for a session timeout? I want to redirect the user to a specific page informing them that their session has timed out and they need to log back in again. I want to set up a custom error in the web.config file based on this error, but I don't know what the error code is. Something like: <customErrors mode="RemoteOnly" defaultRedirect="/error.html"> <error statusCode="403" redirect="/accessdenied.html" /> <error statusCode="404" redirect="/pagenotfound.html" /> </customErrors>