|
Hi,
Iam working on a web application MyApp. I have a root folder My App and a sub folder Media inside MyApp with images.
The images are uploaded and downloaded through the application.
I want to secure this folder Media so that no one can access the images by typing the URL http:// //MYApp/Media/ in the address bar .
How can i block the access to images through browser such that the upload and download via application is not affected an no one can access images also?
Any kind of help will be appreciated.
Thanks
Ramya
|
|
|
|
|
Go to IIS default website list, in that go to the properties of your website and uncheck the 'directory browsing' option.
Sathy
|
|
|
|
|
Create a specific user for your application and grant that user read/write privileges. Then disallow similar privileges for the standard IIS account. Then use impersonation to execute the functionality from within your application.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
hello frnds,
i have developed a application that take care of transaction handling.
i have create a transaction obeject and update four tables. In this operation if error occoured then it will call rollback() else calls commit() method.
but when 4 user accessing site same time then transaction handing demo throughs an exection fro 2 users
what should i do to solve the problem????
where i am wrong??
help
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
I am unable to understand ur problem and May i know please , what exception , u r getting?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
|
MembershipUser mu;
mu = Membership.GetUser(DdlUseName.SelectedValue);
mu.ChangePassword("asdfgh@", "asdfgh$");
|
|
|
|
|
|
<membership userIsOnlineTimeWindow="1">
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add connectionStringName="SIMSys_ConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
In web.config the above code is given The error displayed is string or binary datat truncated.
|
|
|
|
|
Please help me sir..........
|
|
|
|
|
Have you debugged through and found which line is giving the error. What value is your list box returning?
|
|
|
|
|
hi i am using a uploadfile control trying to save my file into a folder in the project instead of using a static file path.
anyone know the syntex to get the project path or any other way this can be achieve?
|
|
|
|
|
Not 100% sure what you're after, but Server.MapPath("") will give you the physical path to the current file - you can amend the parameter accordingly to get the path to another file (insert a re;lative file path). If that's not what you want, maybe the Request.ServerVariables collection will do it for you.
|
|
|
|
|
thanks very much for your help
|
|
|
|
|
hi
can any body tell me how can i create a popup with click a button? i wrote this code but it dose'nt work.
Response.Write("function d(){windows.open(Default2.aspx);}")
|
|
|
|
|
You know, it's not that I want to be unhelpful.. but...
a) if you can't figure this out for yourself you should maybe consider doing something else. Here are two hints: 1) Try Google. 2) Try loking at the source code of any webpage that generates a popup and see how they've done it.
b) you're in the wrong forum - try web development
|
|
|
|
|
|
You're outputting a function to the screen. Do you have code somewhere else that actually calls this function?
|
|
|
|
|
i write just this form:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(function d(){windows.open
('Default2.aspx', 'kk', 'width:400;height:150;scrollbars:no');},");
}
|
|
|
|
|
It's hard to know where to begin with this, it is wrong in so many ways...
If you want Button1 to open a new window on being clicked you need to add client side javascript to a) do this and b) stop the postback (unless you want this too). You can ad this from your code if you want by adding this in the page_load event
Button1.Attributes.Add("onclick", "window.open
('Default2.aspx', 'kk', 'width=400,height=150,scrollbars=no'); return false;");
But unless you either want the postback event as well (in which case don't return false) and/or want to dynamically build the script (ie mayb popup a different window depending on ohther factors| you needn't have serve control at all - just use a normal inoput button on your page and load the script there
<input type="button" onclick="window.open
('Default2.aspx', 'kk', 'width=400,height=150,scrollbars=no')" text="Submit">
(which is pretty much how the server side version will rendier it on the page, if you lok at the source coed after running it.)
|
|
|
|
|
thanks for ur help.
but if i put it in page load, firest open the pop up and then run the othe code that are in button1_click. but i want run the code and then open the window.
protected void Button1_Click(object sender, EventArgs e)
{
a = 1;
Session["a"] = a.ToString();
Response.Write("function d(){windows.open
('Default2.aspx', 'kk', 'width:400;height:150;scrollbars:no');},");
}
|
|
|
|
|
element.style.color using this iam able to change only one cell color how can get the change entire row color
|
|
|
|
|
In the RowDataBound event, you can format an entire row like this:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if( < some boolean statement here > )
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
}
}
|
|
|
|
|
wat u gave is right sir but i want this to in javascript becoz element.style.color i wrote in javascript
|
|
|
|
|
The GridView outputs a html table to the browser so if your javascript is changing the colour of one cell then you are accessing the <td> tag, you need to access the parent <tr> to style the entire row.
|
|
|
|