Jump to content
Xtreme .Net Talk

Susana

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Susana

  1. hello Derek Stone, sorry for making you wait... and thank you for your reply... your suggestion is correct, based on other articles I read. But I can't make it work on my application... I might be missing something... here is what I am doing: in HTML of the aspx file I placed: <%@ OutputCache Duration="2700" VaryByParam="none" VaryByCustom="uid" %> and in global.asax.vb I placed these: Public Overrides Function GetVaryByCustomString(ByVal context As HttpContext, ByVal arg As String) As String If (arg = "uid") Then Return HttpContext.Current.Session.Item("userid").ToString() End If End Function but whenever I logged in twice with different users, same menu page is displayed. The cached page of the first user. help me further please... thank you so much...
  2. Hi Robby, sorry if i replied quite late already... thanks for your time... what i want is i want to cache the menu page for each userid... the menu items displayed on the menu page vary depending on the user's access..
  3. hello to all, can anyone help me? I want to cache my pages based on VeryByParam=userid. The value for userid comes from a Session. The problem is almost all the pages in the application should be cached by userid and i don't want to recode all of them just to pass parameters like Response.Redirect("../Menu.aspx?userid=" & Session("userid")). Is there anyway that i could add immediately the value to the directive? example, <%@ OutputCache Duration="2700" VaryByParam="Session('userid')" %> but i already tried this one and it won't work. or how do i use the value coming from a hidden field. I also tried this one: <%@ OutputCache Duration="2700" VaryByParam="userid" %> ... ... .. .. <FORM>.... <input id=userid type=hidden value=<%=Session("userid")%> </FORM> but even if a different user already log, same page as the first user would be displayed. Sorry if my explanation is not clear enough but i hope atleast you understand what I meant... hope to hear from you... anyone :confused: thanks.
  4. Thanks atoz, Got it. It's now working ok. I should have used the textarea html control. Thanks again.:D
  5. HI, can anyone help me how to remove the scrollbar of a multiline textbox web control. I am to print the html layout and the scrollbar should not be displayed. Anyone? Thanks.:)
  6. Thanks. But my project is in Net so I didn't find the events button in th property window. But what I did was to make a public sub event: example uf_changed() and called it in the html code like this: <asp:DropDownList id="ddlrano" tabIndex="2" runat="server" Width="80px" AutoPostBack="True" OnSelectedIndexChanged="uf_changed"></asp:DropDownList> This now works. Thanks. :)
  7. Hi there, I am trying to set the pagetimeout for my NET application. I have added this line to web.config just above the sessionState section: <httpRuntime executionTimeout="90"/> but it seemed not working. Though the timeout="20" under the sessionState works. Am I doing it correctly or is there other way to set the execution timeout. Thanks.:)
  8. Good day Thomas10001, How do you catch the itemchange of a column in the datagrid? The scenario is I have a dropdownlistbox column and beside it is a textbox whose value is dependent on the selected value in the dropdownlistbox. These two fields are contained in a datagrid. Could you help me? You said on your first thread that you are able to catch the TextChanged event. This might help me in my problem. Could you give me a sample code for this? Thanks. :)
  9. Hi Lee, Thanks for the tip. This could help me in my other printing problems. But unfortunately, this is not what I need at the moment. I am trying to print a batch of records directly to a barcode printer, which is a network printer, using TCP/IP. Initially (for investigation purposes), I have these scripts: *******start code******* Public Class PrintBarCode Inherits System.Web.UI.Page Public Const GENERIC_WRITE = &H40000000 Public Const OPEN_EXISTING = 3 Public Const FILE_SHARE_WRITE = &H2 Public Shared LPTPORT As String Public Shared hPort As Integer Public Shared retval As Integer Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _ ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, _ ByVal dwShareMode As Integer, _ ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, _ ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, _ ByVal hTemplateFile As Integer) As Integer Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer 'Dim retval As Integer Public Structure SECURITY_ATTRIBUTES Private nLength As Integer Private lpSecurityDescriptor As Integer Private bInheritHandle As Integer End Structure Public Shared Function Print() Dim Texxxt As String 'Dim SA As SECURITY_ATTRIBUTES Dim SA Dim outFile As FileStream, hPortP As IntPtr LPTPORT = "LPT1" Texxxt = "testing" hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0) hPortP = New IntPtr(hPort) 'convert Integer to IntPtr outFile = New FileStream(hPortP, FileAccess.Write, False) 'Create FileStream using Handle Dim fileWriter As New StreamWriter(outFile) 'MessageBox.Show(RichTextBox1.Text) ' fileWriter.AutoFlush = False fileWriter.WriteLine("Testing") fileWriter.WriteLine("Hello World2") fileWriter.WriteLine("Hello World1") fileWriter.WriteLine("Hello World2") fileWriter.Write(Chr(12)) '12 fileWriter.Flush() fileWriter.Close() outFile.Close() retval = CloseHandle(hPort) End Function End Class *******end code******* This also came from a help... :) Using LPT1 or any other local printers work but when I change the value for LPTPORT with a network printer, "//dbpweb03/Prodigy Label Printer" which is the barcode printer, the CreateFile() function returns -1. to give you an idea of what I really need, below are foxpro codes, which does print records directly to a barcode printer. It also sends escape characters to automatically configures the barcode printer at runtime: ? CHR(2) + "L" + CHR(13) &&: ' ENABLE PRINT MODE ? "H15" + CHR(13) && : ' SET BURN TIME (HIGHER = DARKER) ? "PC" + CHR(13) && : ' SET PRINT SPEED TO 2.0 IPS ? "SC" + CHR(13) && : ' SET SLEW RATE TO 2.0 IPS ? "O0000"+CHR(13) && : ' SPITS OUT THE LABEL IN BATCH MODE 'prints one by one a record ? CHR(2) + "L" + CHR(13) &&: ' ENABLE PRINT MODE ? "H15" + CHR(13) && : ' SET BURN TIME (HIGHER = DARKER) ? "PC" + CHR(13) && : ' SET PRINT SPEED TO 2.0 IPS ? "SC" + CHR(13) && : ' SET SLEW RATE TO 2.0 IPS ? "O0000"+CHR(13) && : ' SPITS OUT THE LABEL IN BATCH MODE I hope you could help me on this. This is actually my first time to use VB.NET so any tips will be of great help. Hope to hear from you soon. Thanks in advance :)... Susana
  10. Hi, May I know your script? I also neet to print using a network printer through script. I don't know how to call the network printer using a CreateFile(). I tried calling a local printer port and worked fine. We can investigate on this together since I also need to specify fonts to printer by script since I will be printing a barcode label. Thanks.
  11. Hi, I am making an application in Net wherein the data is to be send directly to a barcode printer. I tried the script above by DotNetVirgin (thanks by the way) but I got an invalid handle value of (-1). I am using a shared printer port. Can you (anyone) please help me? And also, do you know how to directly send the Cofiguration Settings to the printer? Thanks! :)
×
×
  • Create New...