|
You are going to put something in the session. What that is, is up to you. Ideally, I'd put an array of ids that represent roles, and then do role based security through the site.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
How can I create a row in unbound gridview that the content is a hyperlink? (I don't want to bind gridview to DB) (yeah it's not logical, but I want to do it!)
Best wishes
|
|
|
|
|
I'm trying to change the file permissions of one of my .aspx files to include only one group (of which I am a member). However, when I try and authenticate, it tells me my credentials are invalid. If I do this with any other type of file (eg. html), it works, pops up the authentication box, I enter my password, page is displayed. Only happens with .aspx I'm stumped. :/
|
|
|
|
|
Is there a way to overcome the
"The state information is invalid for this page or might be corrupted."
error in firefox
Bye
|
|
|
|
|
Doses it happens every time Accsessing or Postback?
Have you tried Internet Explorer?
|
|
|
|
|
occurs when i do postbacks. I wait until the page is loaded but when i do it time and again i get it in firefox.
I have to fix this error for firefox.
Bye
|
|
|
|
|
Try to disable viewstate for each control and se if it is any better. Did you used Windows Update and updated your .net platform?
|
|
|
|
|
Hi,
.NET 1.1 Question:
I have httpModule that implements IHttpModule in order to rewrite url´s. I need to store a value or in some way maintain a value between different http requests. I have been trying to accomplish this by implementing the IRequiresSessionState interface and with numerous event handlers. Is there anyone who know how to deal with this issue or can push me in the right direction?
Thanks in advance
Regards
/Rip
|
|
|
|
|
HttpContext.Current.Session? HttpContext.Current.Cache?
Jon Sagara
Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined!
-- Dr. Zoidberg
.NET Blog | Personal Blog | Articles
|
|
|
|
|
I guess session will be available in PrerequestHandlerExecute event. Have you tried there ?
|
|
|
|
|
Hi, thanks for your reply. I have tried that event handler. I may do something wrong in the implementation...
Regards
/Christoffer
|
|
|
|
|
How to stop, start a job already scheduled in the "Windows Scheduled Task" in the web server using ASP.Net?
Al
|
|
|
|
|
Hi Guys,
can anyone help me with with my code. i have a datalist and some textfield with a button to submit. once submitted, the page should rebind it'self, but it seems not working. see my code below:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class mssgboard_Messageboard : System.Web.UI.Page
{
SqlConnection datalistconn;
SqlDataReader datalistdr;
SqlCommand datalistcmd;
SqlConnection conn;
//SqlDataReader dr;
SqlCommand cmd;
void Bindata()
{
try
{
datalistconn = new SqlConnection(ConfigurationManager.ConnectionStrings["CmsDb"].ConnectionString);
datalistcmd = new SqlCommand("SELECT nam,phone_number,email,comments FROM tbl_mssgboard ORDER BY refid DESC", datalistconn);
datalistconn.Open();
datalistdr = datalistcmd.ExecuteReader();
if (datalistdr.Read())
{
DataList1.DataSource = datalistdr;
DataList1.DataBind();
}
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
finally
{
datalistdr.Close();
datalistconn.Close();
}
}
protected void Page_Load(object sender, EventArgs e)
{
Bindata();
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
try
{
conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CmsDb"].ConnectionString);
cmd = new SqlCommand("INSERT INTO tbl_mssgboard(nam,phone_number,email,comments) VALUES(@nam,@phone_number,@email,@comments)", conn);
cmd.Parameters.Add("@nam", SqlDbType.VarChar,50);
cmd.Parameters.Add("@phone_number", SqlDbType.VarChar, 50);
cmd.Parameters.Add("@email", SqlDbType.VarChar, 50);
cmd.Parameters.Add("@comments", SqlDbType.VarChar, 50);
cmd.Parameters["@nam"].Value = this.txtname.Text;
cmd.Parameters["@phone_number"].Value = this.txtphone.Text;
cmd.Parameters["@email"].Value = this.txtemail.Text;
cmd.Parameters["@comments"].Value = this.txtcomments.Text;
conn.Open();
cmd.ExecuteNonQuery();
this.txtname.Text = "";
this.txtphone.Text= "";
this.txtemail.Text = "";
this.txtcomments.Text = "";
Bindata();
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
finally
{
conn.Close();
}
}
}
i will appreciate your professional expertise.
thanks
|
|
|
|
|
datalistconn is declared as global.
When postback, Excepton Occours, becase you can't open SqlConnection if it is already opend
|
|
|
|
|
I am trying to begin a simple web service application in ASP.NET. The app is to FlightRight, For this simple example, the service will support a single method, called FlightStatus. Clients call this method, passing it a flight number, and our service will return the expected arrival time of the flight. Simple right. not for me . Keep getting this error. Can somebobody please tell me where i am going wrong.
Code here
<WebService(Namespace="http://localhost/FlyRight/", _<br />
Description="Flight Information Service") _<br />
Public Class FlightStatus<br />
<br />
<WebMethod(Description="Submit the Flight Number _<br />
and a time will be returned.")> _<br />
Public Function ArrivalTime(ByVal FlightNum As String) As String<br />
<br />
Dim theTime As String<br />
<br />
Select Case FlightNum<br />
Case 1001<br />
theTime = "12:30 AM EST"<br />
Case 2002<br />
theTime = "4:15 PM EST"<br />
Case Else<br />
theTime = "INVALID FLIGHT NUMBER"<br />
End Select<br />
Return theTime <br />
End Function
Error
Access to the path "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\flyright\1c2b63af\df178987" is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\flyright\1c2b63af\df178987" is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
|
|
|
|
|
Sounds like the user that you are impersonating, or the aspnet user does not have the appropriate privleges to run asp.net temp files.
|
|
|
|
|
hi
i'm workin with Visual Studio 2005 to write my asp .net 2 codes, in my PC when i run my website in debugging mode design mode will be locked, but it won't happen if i work with my laptop
anybody knows how to unlock design mode when you are running and debugging your website?
p.s. there was no VS category in messageboard thats why i choosed asp .net category to post my question, hope my question was related to this category.
thank you
|
|
|
|
|
Farhad Eft wrote: there was no VS category in messageboard thats why i choosed asp .net category to post my question, hope my question was related to this category.
Err...what about this[^]?
Paul Marfleet
|
|
|
|
|
Hi all,
I am plannin to develop chat application in ASP.Net
I dont have any Idea of notification server for web based applications
I am looking for the information on notification server for web based applications
please send me the links
i am not able to find out proper information
and i am also very new to ASP.Net
send me the links on notification server and web based chat programs
i hope i will surly get help from u people
thank u
|
|
|
|
|
The only way to write a useful chat program as a web app is to use AJAX. I'd say you'd be better off doing something else before you attempt this.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I need a VB script to pulling the url and put the sub domain portion in a variable.
I have the url to string function, but running into problems trying to pull out just the subdomain name. Like joe.mysite.com I only want joe, but if they don't have a subdomain then put in a default value like www.
I can't do a inStr because their are more than on ".".
Thanks
Chris Stewart
www.pluginforsuccess.com
|
|
|
|
|
Hello friends,
I am having some problem while accessing the required value from the datareader.
Below is the sample code that i have wriiten................
SqlConnection con=new SqlConnection("server=localhost;database=dept;uid=sa;pwd= ;");
SqlCommaned cmd=new SqlCommand();
Button1_Click(...)
{
cmd.CommandText="select fname from stu where sno=@sno";
cmd.Parameters.Add("@sno", TextBox1.Text.tostring();
cmd.connection=con;
con.open();
string str;
DataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
str=dr.GetValue(0).ToString(); //Error: string str is not initialized
}
con.close();
}
But if i retrieve the value in a label then this code is working fine and i m getting the required valued in the label.
Tell me that how to resolve this problem.
I want to store the required valued directly in the local variable.
Plzzzzzzzzzzz help me
Deepak Nigam
|
|
|
|
|
Do you not understand "string str is not initialized"
string str;<br />
string str = string.Empty;<br />
I didn't get any requirements for the signature
|
|
|
|
|
str=dr[0].ToString();
You have a Nice flaw in this method.
If your reader has > 1 lines then you always display the last value from the reader.object
|
|
|
|
|
deepaknigam11 wrote: string str;
string str="";
|
|
|
|