|
john_paul wrote: How do you get the System.Web.HttpContext.Current.Request.ServerVariables("HTTP_REFERER")
Isn't HTTP_REFERER a HTTP Header and not a Variable?
System.Web.HttpContext.Current.Request.Headers
|
|
|
|
|
Don't bother with server variables or headers. Just use the Request.UrlReferrer[^] property directly.
|
|
|
|
|
I have a datalist having a dropdownlist control on each row. On selecting a particular item of this dropdown, I need to display a page in that particular row of the datalist. There are five different pages and the selection of the page to be displayed depends on the item selected in the drop down list.
Actually, the controls on the pages is waht i need. So instead of the pages if you have any other option do let me know.
Note : The number of rows in the datalist keeps on varying.
|
|
|
|
|
Hi guys,
I am new to ASP.net and I am trying to achieve the following:
I have created a login page where I want only 1 user logged in at any period. Is there a way to get the current # of user logged in, in ASP.Net?
Basically, when second user tries to login, I want to check if there is another user logged in. I tried using session but that doesn't work because each user is on a different computer browsing the site.
Please help!!!!
Sameer
|
|
|
|
|
Saamir wrote: I have created a login page where I want only 1 user logged in at any period
what do you meant only 1 use logged in at any time? I hope you not restricting Only ONE user to connect to your application at a time. If that is what you want, you are in the wrong place. Web app are meant to be used by multiple users at a time.
If you want to limit to a single login to each user, then you need to track who is logged in. When a user logs in then flag that in your users table. Then when the user logs out, remove the flag. Then you need to handle end of session event and remove the flag for that user. When you notice a user tries to log in multiple times, then you can redirect them to different page (may be user already logged in message)
|
|
|
|
|
Hi Yusuf,
Yes I want to only allow one user at a time on the webpage considering the sensitive information processing the page does. Are you saying I should use Session_Start and Session_end? If so, pardon my ignorance but how do I implement these functions?
Sameer
|
|
|
|
|
Saamir wrote: Session_end
Remove the logged on status of the user
|
|
|
|
|
Yusuf,
I know that is what I need to do but my question is how do I go about doing that. If I am updating the database then how do I know that the user has not just closed the webpage instead of loging out.
Do you know what I mean?
Sameer
|
|
|
|
|
I don't know your level of asp.net competency, but your question is a bit silly
- Session_End signals the session is expiring, has nothing to do with user logging out or browser closing
- Browser Closing - There is no way you can detect this from the server. You can write some js to detect browser closing ( mind you there is no browser support for this, all is behind the door hack)
- user logout - the user clicked on logout, so you know that, don't you, don't you....
|
|
|
|
|
Yusuf,
dude, it is just a question, no need for expertise talk or sarcastic talk. Hats off to your smartness and thank you for your help.
Sameer
|
|
|
|
|
no pun intended
|
|
|
|
|
Hi,
I have created a string using StringBuilder class. This string is an xml.
Now my question is that how do i pass this string to xmlTextWriter or XmlDocument class to get the correct format of the string ?
I don't want to start creating the xml using XmlDocument class or XmlTextWriter as it's really cumbersome to nest the xml in it. It's all done using StringBuilder and now i just have to correct the format of the string..
Any idea ??
Thank You
Andyy
|
|
|
|
|
XmlDocument has a method LoadXml that takes a string.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
ok for instance,
testStr is StringBuilder type with having complete xml stored in it.
Now can you please show me the syntax, how can i pass this testStr to XmlDocument to get the correct xml format output.
Thank You
Andy
|
|
|
|
|
What are you trying to do exactly? I thought perhaps you were trying to validate the xml, in which case you could by trying to load it.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
created xml using StringBuilder which is giving non - xml format as a output but i want that string to be displayed like a normal xml file.
|
|
|
|
|
AndyInUK wrote: and now i just have to correct the format of the string..
What does that mean?
|
|
|
|
|
basically xml is stored as a string using StringBuilder which ends up with non xml format and hard to read. So one way is that i fix the format manually which is again a pain. So i am asking if there is any second way which can correct the format of the string as xml.
I hope it's clear now.
|
|
|
|
|
So you want pretty XML? Load it into an XmlDocument, then use either WriteTo or WriteContentTo (I forget what the distinction is) to write to an XmlTextWriter. The XmlTextWriter can be configured for indentation. The XmlTextWriter will need to use an underlying stream, just use a MemoryStream for that. You should be able to read the result via a StreamReader.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
I would take the time to learn about the XmlTextWriter. It made my life so much easier when I had to create an XML file for integration with another system.
Use this to get started ...
Dim writer As New XmlTextWriter(sXMLPath & sXMLName, Nothing)
'Use automatic indentation for readability.
writer.Formatting = Formatting.Indented
'Write the root element
writer.WriteStartElement("REPORT")
writer.WriteStartElement("FORMULA")
writer.WriteElementString("FORMULA_ID", sField0)
writer.WriteElementString("FORMULA_CODE", sField1)
writer.WriteElementString("VERSION", sField2)
writer.WriteElementString("DESCRIPTION", sField3)
writer.WriteEndElement() ' close formula
writer.WriteEndElement() ' close report
'Write the XML to file and close the writer
writer.Close()
|
|
|
|
|
I have a gridview control inside of a panel. The panel has scroll bars set horz and vert. I want all column headings and column text to not word wrap. If I turn off word wrap for column headers and items it still word wraps. How do I get word wrap to work?
|
|
|
|
|
Try putting the grid in a table and applying the style setting:
style='table-layout: fixed;'
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
|
hi friend
i am using chart control of asp.net. it work properly.
i want to save image of chart from page on bottom click? Please help me.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
In my project i need to make a web service that uses massage queuing.
for it i need "web service message queue(wsmq)"
So can any body give me some useful Link about it
Thanks in advance
Raghvendra
|
|
|
|