|
For that you have to capture the browser close event from javascript and if it is browser close then open a new page remove the session from server side of that page then close that page.I have impleneted in this way.The sample code is :
Javscript code to capture the browser close event and accordingly open the new page to remove the session
function CloseSession() {
if(window.event.clientX < 0 && window.event.clientY <0)
{
window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
}
}
Call this method on unload of your master Body .
onunload="DeleteUserLog()"
Now in CloseSession.aspx pages, you can do what ever you want and register the client script to close it automatically after doing the task.
Hope it'll help you.
Cheers!!
Brij
|
|
|
|
|
|
add Session["user"]=user;
clear Session.Remove("user");
modified 27-May-14 4:55am.
|
|
|
|
|
hi,
in my application i am using asp:menu control. when there is large amount of data on a page the menu control starts working slow.
when i added
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE6" />
tag on the master page before doctype the menu started working properly, but the menu stylesheet changed. in the stylesheet i had to add a html td tag eg:
td
{
font-size:12px;
font-weight:bold;
font-family:Arial, Helvetica, sans-serif;
margin-left:5pt;
line-height:15pt;
}
this solved the stylesheet issue.
I want to know why i have to add <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE6" /> for making the menu control fast and why i have to add td tag in stylesheet.
Thanks
Sandeep Kumbhar
|
|
|
|
|
Hi,
I developed one reporting service application from VS - File - new Project - Bussiness intelegence projects - report server project wizard from visual studio 2.0, The report is working fine and i hosted in a virtual directiory also. now am trying to deploy the application its showing error like , A connection could not be made to the reporting server http://localhost/reportserver. So how to overcome this problem can you anyone please give me a right solution.
Thanks in Advance,
kannak....
kannak
|
|
|
|
|
Hello guys,
I just have some text in two separate labels that needs to be displaed side by side, so I'm trying to align the text horizonally (right align).....and text-aligh: right; property doesnt appear to be doing that. If I were to do a float:right then the text of first label will go all then way to the right....all I want to do is something like this example below:
6 Open docs
20 Closed docs
where 6 = text of first label and 20 = text of second label
I want to display the example above in the following manner:
6 Open docs
20 Closed docs (notice how the two numbers 6 and 20 are right aligned and the text is left aligned
If text-align doesnt work, how do I do this? Any help would be appreciated!
Thanks
Tina
|
|
|
|
|
This is becuase, you are not using any table or div. you can either apply "left" or "right" align on text block. so you need to seperate the text/label in different < TD > tag in order to make some part right align (the numbers) and some part left align (the text).
i.e. try like this...
<table width="500px">
<tr>
<td style="text-align: right">
6</td>
<td colspan="2" style="text-align: left">
Open docs</td>
</tr>
<tr>
<td style="text-align: right">
20</td>
<td colspan="2" style="text-align: left">
Closed docs</td>
</tr>
</table>
|
|
|
|
|
Hi there, thanks for the response....
Well you are right (i tried your html above and got the correct formatting), but unfortunately table is not as option...they want only spans or divs (apparently tables are considered evil at my work.
So according to your message, what I'm getting is that since I'm using span, that's why text-alight isn;t quite working. You also said that div will work just fine, so shouldn't that mean if I were to replace table with divs in your example above, it shold work....well i tried it and it didn't. Hers's what I did.
<pre>
<div style="text-align: right">
6
</div>
<div style="text-align: left">
Open docs
</div>
<div style="text-align: right">
20
</div>
<div style="text-align: left">
Closed Docs
</div>
</pre>
Is there a way to accomplish this with div and or spans?
Thanks,
Tina
Is there a way to accomplish this with div and or spans?
Thanks,
Tina
|
|
|
|
|
i think this is format you are looking for
<div><b align="left">6</b> <b align="right">open docs</b></div>
<div><b align="left">20</b> <b align="right">closed docs</b></div>
|
|
|
|
|
hi
I am posting code wherein i am populating my datatable from an excel sheet and reading the sheet name through the user input in textBox5. Inspite of wrong value in the textbox my catch code do not execute and instead the default error page is displayed where as the expected routine is that it displays the message in lblmessage so that user corrects the entry.
Try
query = "SELECT * FROM [" & TextBox5.Text & "$]"
'Create the connection object
conn = New OleDb.OleDbConnection(connString)
'Open connection
If conn.State = ConnectionState.Closed Then conn.Open()
'Create the command object
cmd = New OleDb.OleDbCommand(query, conn)
da = New OleDb.OleDbDataAdapter(cmd)
ds = New DataSet()
da.Fill(ds)
Catch ex As Exception
lblMessage.Visible = True
lblMessage.Text = (ex.ToString())
Finally
conn.Close()
End Try
may i request guidance from experts to understand the above problem
thanks in advance
kris
|
|
|
|
|
Hi all
I find that on server transfer the size of font originally defined for html text is growing. I don't think this should be the behavior and what is the remedy to ensure that my page has consistent look.
kris
|
|
|
|
|
it will be any syntax error in css
|
|
|
|
|
Threre Is a ASP.NET Web Service
I want to use the SOAP protocol to call this web sites. I use the gsoap middware to call the Web Service.
When calling the web service, if the network is stopped and then comeback, does the soap protocol can assure the data is transmited just as the TCP/IP protocol.
Another question, how to count the data bytes when use the TCP/IP protocol or use the SOAP protocol?
|
|
|
|
|
In OSI model, SOAP protocol is not on the same layer as IP/TCP. IP/TCP is a transform layer, serving the SOAP protocal. In another word, your SOAP may be based on the IP/TCP transform layer, just like HTTP is based on IP/TCP or other protocols on the transport layer.
|
|
|
|
|
Can abybody please tell me
What change to the web.config would cause SessionID to be stored in the URL of a web request?
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
When a user visits a Web site for the first time, the site creates a unique ID, known as a Session ID. The Session ID is unique for that current Session, making it possible for the server to keep track of the user's current Session information.
The Session ID is usually stored in the user's cookies, using settings, like the following, in web.config:
<b><sessionState cookieless="true" /></b>
If you decide to use a cookieless session, the session ID is, instead, stored as part of the URL, like this:
http://www.myapplication.com/(anf4vuup3xiq0arjlqla2l55)/WebForm1.aspx
Cheers
Prosanta Kundu
|
|
|
|
|
Also you can go through to this very helpful Link.
It'll help you.
Cheers!!
Brij
|
|
|
|
|
I use a Details View associated with an AccessDataSource.
I would like to retrieve in C# the value of one or more fields of the Details View, to use it as parameters in a query.
How can I access to a value in a field of Details View (in c#) ?
|
|
|
|
|
I have some Grid View and Details View associated with an AccessDataSource.
I use paging and with some button I change the SELECT in SelectCommand of the AccessDataSource. If the result of SELECT is in more than one page, when i click on the second page (or more) the SelectCommand will refresh to the initial SELECT, so i lost the results of the SELECT.
The AccessDataSource will be refreshed with the page.
How can i resolve this problem ?
|
|
|
|
|
Hi,
At present I have written a code which reads the data from an excel sheet.
Question:
How is it possible to read from the first sheet of the excel file? The first sheet can have any name.
This is what I am using but IO would like to refer to the first sheet rather than the name as I am doing here:
OleDbDataAdapter cmd = new OleDbDataAdapter("SELECT * FROM [Data$]", strConn);
Thanks
|
|
|
|
|
Hi,
Not sure how automated of a process you are looking for, but a simple fix is to add a way to pass in the name of the first sheet - text box if graphical interface, or command line parameter if console app. During your processing you would swap out the name in the string:
string strSheet = "Sheet1"; // assign appropriate user entry here
OleDbDataAdapter cmd = new OleDbDataAdapter("SELECT * FROM [" + strSheet + "$]", strConn);
// alternately, replace with string builder if you want to be more efficient...
|
|
|
|
|
|
Can Any one Send the coding of Using Crystal Report in ASP.NET 3-Tier Architechture
|
|
|
|
|
I have a GridView with 100 rows and 1 column 5 page. How can I do to this GridView show the same data, but with 4 rows and 5 columns 5 page? In ASP.net 2.0
Thanks ALL
modified on Monday, January 18, 2010 9:34 AM
|
|
|
|
|
I will suggest to use Repeater control with page size 20 for the it.
In your ItemTemplate, put your data in a div tag with style float:left; and fixed width say x.
Put your repeater control in a div tag with width say 5x (5 times div of ItemTemplate).
Thats it!
You can get the desired result.
Hope this will help.
|
|
|
|