Jump to content
Xtreme .Net Talk

uwking

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by uwking

  1. Thanks for sharing your info Thanks guys so, it is impossible to create a webpage on which there is a button the user can click to print the current webpage for a certain number of times? Oh well, if you says so. Thanks for sharing your info. :)
  2. Hello all, I am trying to programmatically print the current web page when I press a button. I currently have the code as below, which uses the javascript print command. ------------------------------------------------------------- btnPrint.Attributes.Add("onclick", "javascript:window.print();"); ------------------------------------------------------------- but this command brings up Print Dialog. I do NOT want to see the print dialog. All I want to do is when the user press the print button, it prints the current web page twice. How can I do that? I am not sure how to use PrintDocument for web pages instead of files. Thanks for reading this!
  3. Thanks a bunch!!! That fixed it, thanks PlausiblyDamp!!! :D
  4. <SIZE=5> Hello gurus, I have been lookin at this for like 6 hours now, and I am turnin to you guys... This below is the error I get <B> --- ERROR BEGINS --- </B> String was not recognized as a valid DateTime. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: String was not recognized as a valid DateTime. Source Error: Line 248: Line 249: string myDateTimeValue = "2/16/1992 12:15:12"; Line 250: DateTime myDateTime = DateTime.Parse (myDateTimeValue); Line 251: Line 252: Source File: c:\inetpub\wwwroot\agentaccountingapp\agent\store_usage.aspx.cs Line: 250 Stack Trace: [FormatException: String was not recognized as a valid DateTime.] System.DateTimeParse.GetDayOfNNY(DateTimeResult result, DateTimeRawInfo raw, DateTimeFormatInfo dtfi) +202 System.DateTimeParse.ProcessTerminaltState(Int32 dps, DateTimeResult result, DateTimeRawInfo raw, DateTimeFormatInfo dtfi) +142 System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +488 System.DateTime.Parse(String s, IFormatProvider provider, DateTimeStyles styles) +30 System.DateTime.Parse(String s, IFormatProvider provider) +11 System.DateTime.Parse(String s) +7 AgentAccountingApp.Agent.store_usage.lstBoxWeek_SelectedIndexChanged(Object sender, EventArgs e) in c:\inetpub\wwwroot\agentaccountingapp\agent\store_usage.aspx.cs:250 System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108 System.Web.UI.WebControls.ListBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26 System.Web.UI.Page.RaiseChangedEvents() +115 System.Web.UI.Page.ProcessRequestMain() +1081 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 <B> --- ERROR ENDS --- </B> By the way, that code is strictly taken from msdn site... There seems to be nothing wrong with the code itself nor import problems... I'm totally lost...HELP!!! </SIZE>
  5. Thanks webjumper, but my question is WHY CAN'T YOU USE Hidden1.Value? In other words, why is it the case that Hidden1 (which is a HTML hidden field) could not hold the value of Request.QueryString ["Something"]? WHY DID IT NOT WORK?
  6. Thanks a bunch!!! Yo, thanks for your help. Those little things always end up annoying the hell outta me. One little question... You said "Hidden1.value" is NOT REQUIRED... but is it possible to use it at all... U don't have to answer that... only if you have time ^_^ Anyway, thanks again, dude
  7. OK, if you look at the original posting at the top (by utpal), he has code fragment as follows: -------------------------------------------------------------------------------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Hidden1.Value = Request.QueryString("textbox").ToString() End Sub -------------------------------------------------------------------------------- Because on the webpage that has the textbox (where the picked date goes) with the id "textbox" gets passed as a parameter as follows: (Look where it's underlined) <INPUT type="button" runat="server" onclick="javascript:cal=window.open('Calender.aspx?textbox = textbox1','cal','width=800,height=800' );cal.setfocus()" value="Button" /> Then, in the following code ---------------------------------------------------------------------------------- Public Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim strScript As String = "<script>window.opener.document.forms(0)." + Hidden1.Value + ".value = '" strScript += Calendar1.SelectedDate.ToString("MM/dd/yyyy") strScript += "';self.close()" strScript += "</" + "script>" RegisterClientScriptBlock("anything", strScript) End Sub ---------------------------------------------------------------------------------- As you can see, "Hidden1.Value" is used here because it would hold the id parameter passed (i.e. "textbox"). So the variable "strScript" should be <script>window.opener.document.forms(0).textbox.value = '02/14/2004';self.close()</script> but in my case, this underlined "textbox" is not there, resulting in javascript error, meaning "Hidden1.Value" was never assigned with Request.QueryString method. If you still don't understand the problem, please let me know exactly what you don't understand. Thank you for your help.
  8. Request.QueryString does not return the name of the string id I have the same problem from this part. My problem is that Hidden1.value is not filled from Request.QueryString("textbox").ToString(); As a result, when i cliick on the date on the calendar, I get a javascript error... <INPUT name="textBox1" type="text" id="textbox1"> <INPUT type="button" runat="server" onclick="javascript:cal=window.open('Calender.aspx?textbox = textbox1','cal','width=800,height=800' );cal.setfocus()" value="Button" /> This ...window.open('Calendar.aspx?textbox=textbox1', ... "textbox" after the question mark is not recognized for some reason... I don't know why... I would really appreciate it if you can figure this out and let me know.
×
×
  • Create New...