|
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="";
|
|
|
|
|
Hi,
I have 1 master page and 1 aspx page. in this aspx page there is one textbox called txtbox1
In master page, there is javascript function, from that JS function i want to access txtbox1.
but document.getElementById('txtbox1') getting null.
what i did wrong?
any sounds
Ramana
|
|
|
|
|
Add the javascript from you code behind page.
this.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "key", "document.getElementById('" + txtbox1.clientId " + ');", true);
Otherwise you might not have the correct clientid in your javascript.
I didn't get any requirements for the signature
|
|
|
|
|
Hi all,
I am working with a team on a web project and every one of us is using internal documentation for all the classes and functions we are using by writting inside the following:
''' <summary><br />
''' Description of the class<br />
''' </summary><br />
''' <param name="ip"></param><br />
''' <param name="url"></param><br />
''' <param name="currentError"></param><br />
''' <param name="errorDate"></param><br />
''' <remarks></remarks><br />
Is there a way that i can extract all the documentation from the application and save it as a soft copy.
thanks
|
|
|
|
|
Yes,
You can , use XML Documention for that.
eg.
///<summary>
///This is A sample Example , Describe your function
///</Sumary>
Void MyFunction()
{
//Your Funmction
}
Now, From Project Property page -> Build
In XML Documentation file -> Give the XML File path
Build the Application.
Check in \bin\Relase file there is a XML file generated.
That's all.
Try to workout on XML Documentation , there are losts of material are available in .net, i have just give u the idea how to start.
Good luck
Best Regards
-----------------
Abhijit Jana
View My CodeProject Articles
"Success is Journey it's not a destination"
|
|
|
|
|
Thanks for ur reply, however i have tried to use it but not working when iam creating a new web site. It is working only when iam using a new class library cause it has one dll file.
|
|
|
|
|
ok, there is an opensource tool Ndoc try it, using this you can do what you want for documention !!!
|
|
|
|
|
hi to all,
how to use datagrid paging in asp.net2.0.
jai
|
|
|
|
|
Enabled the paging section
|
|
|
|
|
hi,
for paging in asp 1.1 we will give like this
<asp:gridview id="datagrid" runat="server" pagesize="3" allowpaging="true" onpageindexchanged="page" autogeneratecolumns="false" width="177px">
public void mouseclick(object sender, DataGridPageChangedEventArgs e)
{
datagrid.CurrentPageIndex = e.NewPageIndex;
datagrid.DataBind();
}
in asp2.0, dont want to give like this
jai
|
|
|
|