|
You can't. ASP.NET will have access only in the website area. It can't access files from some other drive.
|
|
|
|
|
Hi everebody,
After we applied the security update that is described in security bulletin MS07-040 - our ASP.NET 2.0 application started showing garbage data.
I read this http://support.microsoft.com/kb/940521/en-us[^] and suspecting that this is happening beacuse of this.
If we refresh the page then the garbage characters are removed.
Please help if you could suggest anything.
Thanks much.
Regards
modified on Wednesday, January 28, 2009 12:08 AM
|
|
|
|
|
Hi, I am still a newbie in ASP.net development,
I try to learn about nested master page, and I got this problem
Cannot find ContentPlaceHolder 'ContentPlaceHolderUser' in the master page '/OnlinePrayer/MasterPage/AdminUser.master'
I have done some research in internet, but until now, I have not got the right solutions.
basically, in my website, there are 2 master page : AdminUser.master and User.master
and AdminUser is child of User,
In User.Master , I've got this following code
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="User.master.cs" Inherits="MasterPage_User" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>UserPage</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolderUser" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
and in AdminUser.master, i've got this code
<%@ Master Language="C#" MasterPageFile="~/MasterPage/User.master" AutoEventWireup="true" CodeFile="AdminUser.master.cs" Inherits="MasterPage_AdminUser" %>
<asp:Content ID= "SubContent1" contentplaceholderid="ContentPlaceHolderUser" runat="server">
</asp:Content>
I thought that I had define ContentPlaceHolderUser in User.Master, but I dunno why I still got this error? in Admin.Master
I would be grateful if you could give me feedbacks about my problems,
thanks
|
|
|
|
|
Hi,I hope I understand your problem in a correct way.
Here iam giving you the code for two nested master pages and an aspx page which uses these master pages.
try it out.
1.User.master as follows.
<title>Title
Some content in main master page
<asp:contentplaceholder id="ContentPlaceHolder1" xmlns:asp="#unknown">
runat="server">
Child master page will be placed here...
2.AdminUser.Master as follows(child master page for User as you said and here the Master page file is User.Master).
<asp:content id="Content1" runat="server" xmlns:asp="#unknown">
ContentPlaceHolderID="ContentPlaceHolder1">
This is child master page
| <asp:contentplaceholder id="ContentPlaceHolder1">
runat="server" EnableViewState="true">
Contents of pages...
Content in Child master page.
<asp:contentplaceholder id="ContentPlaceHolder2">
runat="server" EnableViewState="true">
Contents of pages.
|
3.Default.aspx page which uses the master page.(Master Page file is AdminUser.Master)
<asp:content id="Content1" xmlns:asp="#unknown">
ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:content id="Content2" xmlns:asp="#unknown">
ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
Hope it helps.
|
|
|
|
|
I am trying to find a way to display the contents of multiline textbox on a print preview page to display and print the entire contents of what the user has typed in. Once the user types in data in the multiline textbox, the data is stored in a SQL database and then retrieved to be displayed on a print preview page to be printed? Any ideas? Sorry if the question is a little easy for some of you but I am a newbie to C# and .Net prgramming. Thanks is advance.
|
|
|
|
|
I can't figure why my images are not showing up on my web form - instead, there is that little icon indicating the image is there (otherwise, it would be a red cross).
I vaguely remember it happened to me a while ago while working with images - but don't know what it was.
Any idea? thanks.
|
|
|
|
|
Is that image really exist? Is that specified path correct?
|
|
|
|
|
Can you post the code that you have written and the path of the image
|
|
|
|
|
Ekjon wrote: I can't figure why my images are not showing up on my web form - instead, there is that little icon indicating the image is there (otherwise, it would be a red cross).
I think the problem is with image path. Run you web site, Right Click on Red Cross Icon, Click Properties. Or check the same from View Source. Now Compare the path of original source and the current source.
|
|
|
|
|
Hi all,
I am facing a strange problem regarding session variables. I developed a website where a kept the login information in Session variables. It worked fine but now Session is not maintained i have checked after response.Redirect the session is lost and the value is null on the redirected page. I have searched a lot and tried many solutions but useless. I have only one session variable which is used to store the user name to display it on all pages and allowing some login based functionality.
Please help me in this issue.
Looking forward to hear a solution from codeproject.
Thank You
|
|
|
|
|
What is the SessionState Mode[^] in your web.config? Is it set to off?
Be careful, there is no Undo Button(Ctrl+Z) in life.
|
|
|
|
|
Dear Sir,
I am using
sessionstate mode="InProc" cookieless="false" timeout="40"
Every thing was working fine a week ago.
Thank You
|
|
|
|
|
Waheed Ur Rehman wrote: i have checked after response.Redirect the session is lost and the value is null on the redirected page.
Can you please put the line of code for Response.Redirect() and Session Store ?
|
|
|
|
|
Hey....U can directly put username in session.
Session["UserInfo"] = LoginName;
and u can access that value in another page like
string Loginname=Session["UserInfo"].toStirng();
|
|
|
|
|
As per his replies, He tried that and problem lies somewhere else
|
|
|
|
|
hi friends,
i am try to get wmv player through COM Components in ASP.NET . i am adding but that object not displaying in ToolBox. how can we will do that. please explain me
thank you yours. somasekhar
j somasekhar
|
|
|
|
|
|
I know it's pretty basic.
I have some image controls on a page.
User will upload the images and the images will show up in the image controls as they are uploaded (there is a max number they can upload).
I was trying to access them to see if imageurl is empty - so I can take the first control to put the image, then the second one and so on.
But it's not working. Here's what I am trying:
foreach (System.Web.UI.WebControls.WebControl webctrl in this.Controls)<br />
{<br />
if (typeof(webctrl) is Image)<br />
{<br />
if (webctrl.ImageUrl.Equals("") == false)<br />
{<br />
++count;<br />
}<br />
else<br />
{<br />
img.Visible = false;<br />
}<br />
}<br />
}
Any idea? Thanks.
|
|
|
|
|
how does it evaluates the LOC - when you try to debug the line below
if (webctrl.ImageUrl.Equals("") == false)
|
|
|
|
|
Hallo,
I have a DataSet from 2 DB tables, and i want to databind some textboxes(say N, created dynamically) at runtime.
Is it possible to have 2-way databinding without using gridview or reapeater etc.
That is, i have a set of textboxes and labels in a table. The textboxes should implement 2-way databinding.
Thanks
|
|
|
|
|
Hi,
Can anyone help me with the following problem please;
I need to drop the 'www' part of a url whenever it is entered by a visitor. So for example if they type 'www.domain.com/' it goes to 'domain.com/'. Likewise it should do the same for specific files and folders eg 'www.domain.com/files/test.jpg' should redirect to 'domain.com/files/test.jpg'.
The updated domain name should be shown in the url.
I am running this on IIS on a dedicated machine over the web. I using the 'redirect' function in IIS i can only get it to redirect to a specific url rather than the exact corresponding file / domain location.
WOuld it be better to do this with a .Net config file?
Help greatly appreciated.
Thanks!!!
|
|
|
|
|
|
You may try like following code snippet
private string newUrl = System.Text.RegularExpressions.Regex.Replace("www.domain.com/files/test.jpg",
"^www\.", String.Empty);
Server.Transfer(newUrl);
Hope I answered you correctly
|
|
|
|
|
I'm trying to pass values within an insert statement, however, I'm not sure what is the best way to pass the most appropriate value to the taskID_PK column bigint identity. The identity column is normally filled in automatically.
An insert statement to the table returns the following error:
Cannot insert the value NULL into column 'taskID_PK', table 'teamwiki.dbo.task'; column does not allow nulls. INSERT fails.\rThe statement has been terminated."
VS 2005 / ASP.NET 2.0
SQL Server 2005 Express
Related links:
Understanding identity columns
Jon
|
|
|
|
|
How does the insert-statement look like? Do you set the identity column explicit?
Regards
Sebastian
p.S: Are you sure that the primary key is generated automatically?
|
|
|
|