|
If we same username from different systems it doesn't effect session from used for same user in another system, ASP.net uses seperate session for each request from different systems or different browsers. If you dont want two users to use same username you can make use of database to check if the user is already logged in or not, Or you can use array of users in global.asax file where the data is global for all usersm, so that you control the user while loggin in (Checking with the global array)...
|
|
|
|
|
Dear frd's
Is it possible to read data from serial port of client system using asp.net web site. Here is my scenario
I will be having computers connected in LAN and a web application which resides on server. Each client computer will be connected to a external machine using serial port and is ready for reading data, external machine measures equipment details and sends through serial port.
Now I need to read the same data using my web page, is it possible?
Like when we do video chatting our web page reads data from web cam and sends the stream to web page. this way how can I read data from client machine to web page.
Please give me suggestions on how to proceed for this.
Thanks & Regards,
Anil Chelasani
|
|
|
|
|
Hello,
I would show a progress bar when i click on the login button, for this i create a picture and i set the propriety Visible on false, in the button code i set visible propriety on true, unfortunatly when i click on the login button the picture don't be appeared, please help met to show this picture, Thank you verry mutch.
|
|
|
|
|
|
Hello,
Thank you for your answer but i would show a picture (progress bar) whene i click on the login button and when i verify if login and password was good i set the picture on hidden. Please help me, thank you verry mutch.
|
|
|
|
|
I think that your login button works by Ajax
If I think true
if your login button is a asp.net control you can use OnClientClick property and set it by a
javascript function name
<asp:Button OnClientClick="return loginFun()"/>
I emitted other irrelevant properties in the pervious code
if your login button is a HTML control you can use onclick property
<input type="button id="loginBtn" onclick="return loginFun()"/>
and in loginFun you show the progress bar
function loginFun()
{
[Your codes]
document.getElementById("progressBar").style.display="inline";
}
and when your ajax response is recieved you can use this javascript code to hide that
document.getElementById("progressBar").style.display="none";
hope to be useful
Mohammad Khansari
|
|
|
|
|
thank you for anwser, but i don't have e progress bar, i have a gif picture, can you helm me to show a gif picture when i click on logon button ? Thank you
|
|
|
|
|
first I want you to answer my question
Q - how does your login button works?
when you click on the button what happens.
the form would be submitted
Or
a XmlHttpRequest (Ajax)would be sent to server for login action
(I answered this situation later)
--------------
about first situation
if form submit is occurred you can not use a progress bar(show an image) to show progress
because whole of your page would be refreshed.
I think that you must study more about HTML and Http to understand what happen when the form submitted
Hope to be useful
Mohammad Khansari
|
|
|
|
|
Hello,
i would show a picture (progress bar), for this i try to do :
<br />
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)<br />
{<br />
<br />
Image2.Visible = true;
<br />
<br />
Authentification au = new Authentification();<br />
MessageBox bb = new MessageBox();<br />
if (Login1.UserName.Length == 0)<br />
{<br />
Label1.Visible = true;<br />
Label1.Text = "Le mot de passe et/ou le login que vous avez entré est invalide.";<br />
Image2.Visible = false;
}<br />
else <br />
{<br />
String url = string.Format("Menu.aspx?login={0}&password={1}", "test", "test");<br />
Response.Redirect(url);<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
<br />
Unfortunatly the picture don't be appear.
thank you verry mutch.
|
|
|
|
|
|
use javascript to display/hide your image.When one sets the visible as false that HTML doesn't render at the page.
Cheers!!
Brij
|
|
|
|
|
abbd wrote: unfortunatly when i click on the login button the picture don't be appeared, please help met to show this picture, T
Showing progress bar is nothing to do with just displaying a image. First of all be clear on why you want show progress bar. If the login process taking time and you want to show progress bar you can use AJAX Update panel and AJAX Progress bar.
http://www.asp.net/Ajax/Documentation/Live/overview/UpdateProgressOverview.aspx[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Dear all,
please any one can help me to understand how this website is working www.ratemyarea.com.
i want to make like this website for me, but i can't do it, any help.
|
|
|
|
|
I am not sure about the answering your questions. You want to use google map in your web application or what ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
yes i want but connect with database.
|
|
|
|
|
|
thanks but if i have a database and i save all the marks in it and i want to retreive all marks to my map how can i do it???
|
|
|
|
|
Check in the last example, I am using AJAX to get the XML data from the server. Just replace the XML datasource with your appropriate data.
It is very easy to do that, I have done that lots of time.
Other than that, you can also place the retrieved points in some hidden field and place markers in the pageload.
Hope you got it.
|
|
|
|
|
Hi peoples,
Need a clarification in MSSQL, here there is no separate board is there,
can i post the SQL question here?
|
|
|
|
|
Ask your Question in General Database forum.It will be more helpful
Cheers!!
Brij
|
|
|
|
|
thanks brij i was looking for the word SQL, didnt see the DB thanks
happy new year
|
|
|
|
|
Happu new year you too dude
Cheers!!
Brij
|
|
|
|
|
Hema Bairavan wrote: can i post the SQL question here?
General Database is most appropriate
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
yes abhijit, i have posted there.. if u have time please check there and revert me
thanks and happy new year
|
|
|
|
|
Hi All
I have the following code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<script language="C#" runat="server">
protected void button1_Click(object sender, EventArgs e)
{
try
{
TextBox1.Text = (TextBox1.Text + "<strong></strong>");
Label1.Text = (TextBox1.Text);
}
catch (System.Web.HttpRequestValidationException)
{
Response.Write("html is not allowed");
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="300px" Width="400px"></asp:TextBox>
</div>
<asp:Button ID="button1" runat="server" Text="strong" onclick="button1_Click" />
<asp:Label ID="Label1" runat="server"></asp:Label>
</form>
</body>
</html>
If i click on button twice I am getting request validation exception which I want to catch.
The error which I am getting is
*************************************************************************
Server Error in '/TextControlOnSite' Application.
--------------------------------------------------------------------------------
A potentially dangerous Request.Form value was detected from the client (TextBox1="<strong></strong>").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBox1="<strong></strong>").
Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\textcontrolonsite\d5a3eadf\30926e30\App_Web_rwvmmuiv.0.cs Line: 0
Stack Trace:
[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (TextBox1="<strong></strong>").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +3310274
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +108
System.Web.HttpRequest.get_Form() +119
System.Web.HttpRequest.get_HasForm() +3312222
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +45
System.Web.UI.Page.DeterminePostBackMode() +65
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\textcontrolonsite\d5a3eadf\30926e30\App_Web_rwvmmuiv.0.cs
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1873; ASP.NET Version:2.0.50727.1433
***************************************************************************
I have put try catch block but it is not executing.
I know that we can use Server.HtmlEncode and Server.HtmlDecode method and also knows that ValidateRequest property of page attribute.But in my case i want to execute some code only on this page when the RequestValidation Exception occurs.
I donot want to handle error in global.asax file.
I want to handle error on this page only.
Please suggest.
Thanks
Regards
Sandeep
|
|
|
|