|
I think making Session.Abandon and checking for some session value from the Application.BiginRequest event will do the purpose. Check if session exists, or otherwise redirect to login screen...
Abhishek Sur
|
|
|
|
|
This lead to an infinite loop.
Regards
Vijay V.
Yash Softech
|
|
|
|
|
this is not working for me.
Can you suggest any other alternate?
IE works fine I have problem with other browsers.
I am using cookies to maintain login.
Regards
Vijay V.
Yash Softech
|
|
|
|
|
Hi,
I have created a Webpage, and on the click of a certain link i want to run a unicast stream from VLC giving an output of RTSP.
Please help.
Regards
|
|
|
|
|
Hi all
I have a problem in processing Semicolon <;> seperated CSV file
Web server Locale "en-US"
CSV file Locale "de-DE"
i will not be able to use "Microsoft text driver"
Is there any known solution????
Thanks & Regards
Pete
|
|
|
|
|
Can't you just open the file, read it line by line and use the Split function to get the values?
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
I need to query the CSV file...
there can be semicolons in the content also, so split will not help...
i need to execute SQL Queries on the file using ADO..
Thanks & Regards
Pete
|
|
|
|
|
Good luck, bro.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
As per I know, if comma is there in your data you must write like
"data1,data2" inside your CSV file, so that it takes it as single data.
Abhishek Sur
|
|
|
|
|
|
If you want to add a confirmation dialog after a user presses a certain button, add an onclick attribute to the button with a confirm statement
btn.Attributes.Add("onclick", "return confirm('Ey, are you sure?')");
Works fine!
|
|
|
|
|
Thanks for the response...well see the thing is that's not the only thing I'm doing in the button's click event handler. In other words, I have code written in the code behind button1_click() event handler. So having said that, can I just use this in addition to the code that is written in the code behind as well??
Also, If I were to do this, how would I do lets say some other processing when the user clicks Yes or OK. Would that code be in the same event handler or should I do that in the Page_load()?
Thanks
|
|
|
|
|
Nope, the code I provided is client side, when the user clicks the button, a confirmation message will appear. If the user confirms that message, your code-behind event handler will be triggered (in other words, the button1_click code runs) of the user does not confirm the javascript confirmation message, no postback will take place (e.g. no code will run server-side).
You can however modify the script so that you CAN run different code on the server if you want (need) to.
|
|
|
|
|
Thanks Eduard, I appreciate it!
|
|
|
|
|
|
Dude, what is your question??
|
|
|
|
|
I am using Visual Studio 2005 and SQL Server 2005+SQL Server MAnagement Studio 2005.i m using Windows Vista home.
when in "SQL Data source" i configure it ,then after selecting "NewConnection",
i select "Sql Client".
then select the Server (.).
But then in the "Database" Dropdownlist,I couldnt find any of the databases i had made SQL Server MAnagement Studio 2005.
i am new to SQL Server 2005.Please help me out...
thanx in advance
|
|
|
|
|
Hi,
I think the way you specify the server is incorrect.
If its locally available give the server name as (local)
else select the server from the drop down list.
Hope it helps
Thx,
Gayani
|
|
|
|
|
rather than dot (.) , please put IP Address or system name. it will resolve your problem.
cheers,
Abhijit
|
|
|
|
|
I am trying to simulate a web-farm environment and I need to implement a simple ad balancer layer for this(C#/ASP.NET 2.0, IIS 5.1). I am doing it via folwing architecture. Feel free to suggest any flaws that can help me resolve the problem.
I have a web-application named LoadBalancer (LB) which has lists of hosts that it needs to connect. All the hosts are running exactly same web application. So let’s say when users connects to LB, it takes him/her to a web-form on app running on Machine1. User hits a button here but let’s say that Mafchine1 becomes unavailable now, which means that LB should try connecting to application running on Machine2. This mean that I need to capture every http request in LB, see which is the device I am currently connected to , Make sure its avaialble (otherwise get the availabe machine’s URL) and then post the http request to that machine. I tried doing it in Application_PreRequestHandlerExecute event but could not figure out how to do it. Bew is the simplied code that I currently have in Gabal.asax.
My questions.
1. Can this be done?
2. My current approach can work?
3. Any code samples will be highly appreicated.
TIA
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
System.Collections.Generic.List<string> ListOfMachines = new System.Collections.Generic.List<string>();
int index = 0;
// Hard-coded for brevity
ListOfMachines.Add("http://Machine1/MyWebApp/");
ListOfMachines.Add("http://Machine2/MyWebApp/");
ListOfMachines.Add("http://Machine3/MyWebApp/");
Application["MachinesList"] = ListOfMachines;
Application["CurrentIndex"] = index;
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
string NextMachineURL = GetNextAvailableMachine(); // This returns the URL from MachinesList in round-robin fashion
// *** Establish the request
System.Net.HttpWebRequest HttpReq = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(NextMachineURL);
// *** Retrieve request info headers
System.Net.HttpWebResponse WebResponse = (System.Net.HttpWebResponse)HttpReq.GetResponse();
System.IO.StreamReader ResponseStream =
new System.IO.StreamReader(WebResponse.GetResponseStream(), enc);
string strHtml = ResponseStream.ReadToEnd();
System.Web.HttpContext.Current.Response.Write(strHtml);
WebResponse.Cse();
ResponseStream.Cse();
break;
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>
|
|
|
|
|
Are you trying to implement a loda balancer ? Will it be run on your live production ?
if yes, then i am suggest rather than try to use own LB try to use any other Third party S/W LB or H/B LB. We are also using Web Farm Architecture for Deploy our web application, and we are using H/W LB.
Because, if you are going to implement LB , then it should be the S/W LB and there is a hughe chanllange to implement it.specially Maintain the client request and session created on server.
So I will suggest you to think on that.
If its your practice purpose, then you can carry on. Good Luck !!!
cheers,
Abhijit
|
|
|
|
|
This is my semester project. Thanks for your reply.
|
|
|
|
|
Hi,
is there any event who work on firefox and IE to catch the clic on the back button!!
Thanks a lot!!
|
|
|
|
|
i dont think there is any such event there.
cheers,
Abhijit
|
|
|
|
|
You can take use of
window.onbeforeunload = function () {
// stuff do do before the window is unloaded here.
}
This event will fire when a page is unloaded... means even your file is closed...
Abhishek Sur
|
|
|
|