|
I think you'd have to keep track of all your sessions at the Application level in order to do that.
|
|
|
|
|
Well Rather killing ..If you want to kill a specific Session..then u can remove that session by Session.Remove("Name of Session")
I hope it satisfies u...
KHATRI
|
|
|
|
|
That deletes a session item from the current session. From what I understood, he wants to abandon a specific session (not the current session, but some other user's session).
|
|
|
|
|
Yes, I did. But I do not know how to use it.
Thanks
|
|
|
|
|
I'm trying to get IE to open a file download dialog, but no matter what I try, it just ignores it and moves on. Everywhere I've searched has more or less the same information on how to use Response.WriteFile; I'm totally clueless as to why this isn't working.
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/x-msdownload";
string thefilename = "Test1.txt";
Response.AppendHeader("content-disposition", "attachment; filename=\"" + thefilename + "\"" );
Response.Flush();
Response.WriteFile(strExport);
Response.Close();
strExport is a valid filename;
At this point I'm not sure what else to try. Two developers I work with also cannot get it working. Grrrr.....arrrgh!
|
|
|
|
|
See the following code:
Dim dwnURL As String = CType(sender, LinkButton).CommandArgument
If dwnURL.Length > 0 Then
Dim filepath As String
filepath = System.Web.Hosting.HostingEnvironment.MapPath(dwnURL)
'Check whether the download file exists or not. if does not exists, send auto-generated email to the admin specificying
'the at which URL it occured and the file which is not found.
If Not System.IO.File.Exists(filepath) Then
Session("FNN_AbsolutePath") = filepath
Session("BackURL") = Request.UrlReferrer
Response.Redirect("~/BrokenLink.aspx")
End If
Dim onlyFileName As String = System.IO.Path.GetFileName(filepath)
' Open File
If Not System.IO.File.Exists(filepath) Then
' popFileNotFound.Link = "" ' ResolveUrl("~/admin/email.aspx")
'popNewMail.Title = GetGlobalResourceObject("mail", "newMail")
' popNewMail.Message = String.Format(GetGlobalResourceObject("mail", "newMailMessage"), _newMailCount.ToString())
popFileNotFound.AutoShow = True
popFileNotFound.Visible = True
Exit Sub
End If
Dim fs As New IO.FileStream(filepath, IO.FileMode.Open)
Dim bytes(fs.Length) As Byte
fs.Read(bytes, 0, fs.Length)
fs.Close()
' Send the file as Response
Response.AddHeader("Content-disposition", "attachment; filename=" & onlyFileName)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(bytes)
Response.End()
I think you need to End() the response rather than Close()
|
|
|
|
|
Yeah, I tried all different combinations using End, Flush, and Close; nothing helped.
This morning I created a standalone project with just a page and a button. The button click event was using the same code to open the download box and it worked fine; dialog box opened right up and gave me the Save or Open options, both of which worked.
I think I might explore using BinaryWrite instead, but since there's nothing wrong with my WriteFile code, I'm not hopeful that BinaryWrite will behave any differently.
|
|
|
|
|
Could this be related to master pages? The response is being called from the content page, but just doesn't open the dialog box.
|
|
|
|
|
the problem I was having was related to Anthem controls, in particular, the button that was supposed to fire the Responses is an Anthem button, and they behave a little differently than your average, ordinary, every day asp button.
Apparently when the 'EnableCallBack' property is true, Anthem uses some javascript to work it's magic instead of a postback; that's the whole point of a callback, I guess, but since my file was sitting on the server, it kinda needs a postback in order to get the data.
So I changed the property to False and the dialog box opened right up.
|
|
|
|
|
Has anyone ever come across a date *and* time picker component for asp.net?
there are zillions of Date *or* Time picker components out there, but I can't seem to find one that allows both at the same time in the same control.
|
|
|
|
|
|
|
I want some fields the edit/insert Mode in a DetailsView control to be multiline textboxes... There is no apparent option for this... anyone know a quick work around?
|
|
|
|
|
<asp:detailsview id="dv" runat="server">
<fields>
<asp:templatefield>
<insertitemtemplate>
<%----%>
<edititemtemplate>
<%----%>
<itemtemplate>
<%----%>
|
|
|
|
|
|
How can I force my required field validators to validate one button OnClick but not my 2nd button?
I have 2 buttons within a form. The first button is part of a "Search" form. The 2nd is a logout button.
My search form has a few textboxes that are required to be filled in before advancing so I have required field validators. My logout button however should simply allow the user to logout (validators should not execute).
Unfortunately, if I click my Logout button, the validators display and prevent me from logging out.
So how can I force them to run when the Search button OnClick event is raised but not the logout button OnClick event?
Thanks in advance.
-Goalie35
|
|
|
|
|
Set the CausesValidation property of the logout button to false.
|
|
|
|
|
1- Is there a way to create a user contorl that consist of more then one .ascx page?
2- I have an application that has 6 .aspx pages [update, insert, delete, select etc] and I want to make it either a user control or a webpart for code re-use reasons. Is that even possible? Please help.
Thanks in advance.
Best regards,
Robert
|
|
|
|
|
1 - sure. Create a control that contains the other controls you want to combine
2 - What do you want to make a control, the entire app ? You can turn any page into a control, just move the code into a control and place that control on the page.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You might want to investigate the FormView, it allows you to define a single control to view, update, insert or delete an information to a bound datasource.
You could place one of these FormViews in a user control or custom control . The DataSource can be related to an object model or Sql Database etc in .NET 2.0.
|
|
|
|
|
|
Hi Friends,
I have created a webservice using ASP.net 2.0 wchich sends employees details as a dataset.
on client side i am using classical asp to access that
Dim xmlhttp
Dim DataToSend
DataToSend="companyid="& cstr(Session("companyid"))
Dim postUrl
postUrl = "http://localhost:1286/LoginServices/Service.asmx/GetUserList"
Set xmlhttp = server.Createobject("MSXML2.XMLHTTP")
xmlhttp.Open "POST",postUrl,false
xmlhttp.setRequestHeader "Content-Type", _
"application/x-www-form-urlencoded"
xmlhttp.send DataToSend
dim dataReturned
dataReturned=xmlhttp.responseText
when i use Response.write(dataReturned) it prints data.
My problem is That I want to show data as a formatted text and also want to give user an option to edit the emplohees information and save back to the server. I want to show records in a table but it seems when it returns data its a single string.
I dont know if my apporach is wrong or right.
If any one knows how to create a formatted text or how to put that data into an xml file please help me
thanks
Naveed Kamboh
|
|
|
|
|
Dou have access to the code of the webservice? Then wrap the results in XML-Tags. The XML-Tag-Names are irrelevant, but I should be a wellformed XML-Stream you returned.
Now you can parse the result stream in CodeBehind before your Response.Write-Call OR clientside with JS using JS-DOM.
Regards
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
I've added allowsorting="true" to my gridview properties, but I still don't get clickable headers. What am I missing?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Which data source you are using?
If you are bounding columns in design time then you need to tell sortexpression there.
you can use column name as sort expression. Also bear in mind that DataSet gives builtin sorting and paging options.
Naveed Kamboh
|
|
|
|