catch (Exception ex)
string err = ex.Message;
string script = "alert('" + err + "');";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Msg", script, true);
But sometimes the message doesnt get dislayed and the whole application freezes, i have noticed that its caused by the content of ex.Message
eg "Unable to cast object of type 'System.DBNull' to type 'System.String'." - gives a problem. The easiest thing to do is to replace the ' signs and it works fine, but this is applies to this error message only, is there a generic solution for this problem.
You'll probably want to create an LDAP query against your active directory. There are a number of examples online - just bear in mind that your asp.net process will need to have sufficient authorisation to make these queries.
where FolderName is comming from session.
Its not working but. its showing blank page in result(not even "Page Not Found").
Then I tried another one:
FileStream fs = new FileStream(Server.MapPath(FolderName
+ "/styles/About-Us.html"), FileMode.Open);
byte data = new byte[fs.Length];
fs.Read(data, 0, (int)fs.Length);
string dataString = Encoding.UTF8.GetString(data);
htmlAboutUs.InnerText = dataString;
It is also not working. I have checked that its bringing correct data in dataString but not displaying. mean my file contents are properly read but its not assigned to iframe. Please give some gidence.
That is because you are using MapPath to return the Physical path as seen internally on the server. The browser does not have access to that. You must use a URL (http://domain/folder/styles/About-Us.html)
I wish to know if there is a way to publish a website created in VS2005 to a windows 2003 server using the remote desktop connection.What I have been trying is ....I have created a website in VS2005 and published it locally on the FileSystem.Now if I manually copy it on the windows server 2003 will it work?Morever,I wish to the proper way to publish a website created in VS2005 on windows 2003 server,provided I can connect to windows 2003 server using remote desktop connection only and I dont have admin rights...Please kindly let me know the proper way to do this!!
protected void Button1_Click(object sender, EventArgs e)
protected void Save_Click(object sender, EventArgs e)
//Now here i want to insert value in Database from my textboxes which is created in PH1 and PH2
Last Visit: 31-Dec-99 18:00 Last Update: 24-Jul-21 13:51