|
Hi,
I am using File Upload Control, and i want to place the file in APP_Code folder.
I have made the solution in InetPub-> WWWRoot.
But when i try to upload the file it gives a security error.
What i want is that anyone who wants to upload the file in this folder can upload the file regardless of the Rights he have.
I am using WIn 2k and iis5.
Thanks in Adv.
Deepak Surana
|
|
|
|
|
deepaks3 wrote: What i want is that anyone who wants to upload the file in this folder can upload the file regardless of the Rights he have.
You can't do that. You must grant the rights to do this. I might add that this sounds like a very stupid idea and a sure fire way to compromise your server. Security exists for a purpose.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Umm.. why oh why would you want to even think about doing something like this?
Give anyone, the ability to run arbitrary code on your system..
it's like.. giving the keys to the corvette to the teenager for flunking his driving test..
/shudder
---
Don't be irreplaceable. If you can't be replaced, you can't be promoted.
|
|
|
|
|
How do I get my session state to timeout out at a small interval (for testing purposes)? I tried adding <sessionstate timeout="3"> to my web.config file, but the session does not timeout after 3 minutes. I'm still sitting here 20 minutes later with a fully usable session state.
Any ideas? Thanks in advance.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
try this
in global.asax under Session_Start write the following
Session.timeout="3"
Thanks
Bhasker P
|
|
|
|
|
If you are Using Forms Authentication then in You can use it like..
<authentication mode="Forms">
<forms timeout="30" slidingexpiration="true">
|
|
|
|
|
Hi all,
I would really appreciate your help on the following... I am very new to ASP 1.1, been using 2.0, but have to do some edits to asp 1.1 files.
I get the following error when binding my dataset to a datagrid:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Line 23: dgMembers.DataSource = dsMembers
Here is my code:
ASPX:
<br />
<br />
<asp:datagrid id="dgMembers" runat="server" BorderWidth="0px" GridLines="None" BorderStyle="None"<br />
CellPadding="0" Width="100%" AllowPaging="True" PageSize="15" PagerStyle-Visible="False" AutoGenerateColumns="False"><br />
<Columns><br />
<asp:TemplateColumn HeaderText="Name"><br />
<HeaderStyle Width="70%" CssClass="Grid_HeaderStyle"></HeaderStyle><br />
<ItemStyle CssClass="Grid_ItemStyle"></ItemStyle><br />
<ItemTemplate><br />
<asp:Label id="lblFirstName" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>' runat="server" /><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
<asp:TemplateColumn HeaderText="Age"><br />
<HeaderStyle Width="15%" CssClass="Grid_HeaderStyle"></HeaderStyle><br />
<ItemStyle CssClass="Grid_ItemStyle"></ItemStyle><br />
<ItemTemplate><br />
<asp:Label id="lblAge" Text='<%# DataBinder.Eval(Container.DataItem, "Age") %>' runat="server" /><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
</Columns><br />
<PagerStyle Visible="False"></PagerStyle><br />
</asp:datagrid><br />
<br />
ASPX.VB class:
All labels and datagrid declared
<br />
<br />
Dim dgMembers As DataGrid<br />
Dim lblFirstName As Label<br />
Dim lblAge As Label<br />
<br />
Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
' Put user code here to initialize the data source <br />
' filling the dataset<br />
Dim dsMembers As DataSet = New DataSet<br />
dsMembers = Member.GetAllMembers()<br />
<br />
'Response.Write(Member.GetAllMembers().ToString)<br />
dgMembers.DataSource = dsMembers<br />
dgMembers.DataBind()<br />
<br />
<br />
End Sub<br />
Member.vb:
<br />
Public Shared Function GetAllMembers() As DataSet<br />
Return MemberDA.GetAllMembers()<br />
End Function<br />
MemberDA.vb:
<br />
<br />
Public Shared Function GetAllMembers() As DataSet<br />
<br />
Dim dsMemberResults As New DataSet<br />
<br />
' Create instance of SqlConnection and SqlDataAdapter object<br />
Dim objConn As SqlConnection = New SqlConnection(Globals.GetConnectionString)<br />
Dim objCmd As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM Members", objConn)<br />
<br />
Try<br />
<br />
'Open the connection to the database<br />
objConn.Open()<br />
<br />
' Create and fill a DataSet.<br />
objCmd.Fill(dsMemberResults)<br />
<br />
Catch ex As Exception<br />
Dim strExceptionMsg As String = "Error Executing GetAllMembers(): " + ex.Message + "\r\n"<br />
Throw New Exception(strExceptionMsg, ex)<br />
Finally<br />
'close the connection once retrieving the information is done<br />
objConn.Close()<br />
End Try<br />
<br />
Return dsMemberResults<br />
<br />
End Function<br />
<br />
Playout
|
|
|
|
|
Make sure that the datagrid control declared in the web page .aspx with the ID dgMembers , also in code-behind the variable dgMembers is normally declared with the sample code:
Protected WithEvents dgMembers As System.Web.UI.WebControls.DataGrid
|
|
|
|
|
I love the ASP.NET 2.0 feature which allows one to put the connectionString nodes in the machine.config, but does anyone know how to get those connection strings to show up in the Visual Studio 2005 IDE similar to the way the ones in the local web.config show up? For example, when dragging a SQLDataSource object into the designer, the first step is to configure the datasource, which of course requires that you specify a connection string. The ones that are inherited from machine.config will work, but they aren't available to choose from in the dropdowns of the IDE.
Thanks for you help!
Anthony
|
|
|
|
|
AFAIK, the SqlDataSourceDesginer object (the designer of the SqlDataSource control) uses the object which implements the IDataEnvironment[^] interface to access the connection list of the application at design time and display in the combobox. And it only gets the connections declared in the web.config file of the application, not from the machine.config file which is shared by all applications on the server. Though it's not easy, you may think of customizing the SqlDataSource designer if you want to.
|
|
|
|
|
Thanks for the reply and suggestion. Not sure I'm up to customizing the SqlDataSourceDesginer just for this, but I'll certainly keep that in mind.
Also, the underlying goal I'm trying to achieve might be solved another way if I could get Visual Source Safe 2005 to ignore files that I've excluded from the project. That is, in web.config, I would reference an external file for the connection string, but exclude that file from the project. The problem is, Visual Source Safe still wants to keep that file under source control, so my fellow developers and I would be overwriting each other's connection string file.
The reason we need this is that occasionally one of us will pull in a local copy of the database for the project and hit the road with our laptop. When we get back, we don't want to worry about checking the project back in with connection strings to the portable copy of the DB.
Thanks again
Anthony
Anthony
|
|
|
|
|
Hi Anthony,
Though you can configure the VSS so that it ignores a specified file type, it may affect the other files. There are two work-around options which you may consider:
+ Make the file hidden, the hidden file is automatically excluded from the web site and it's also ignored by the source control.
+ Check in the file, right click the file to open the Properties dialog box, uncheck the Read-only checkbox, you now can edit the file without checking out the file.
|
|
|
|
|
Sweet! Hiding the file works perfectly. Thanks so much!
Anthony
|
|
|
|
|
i want write a number and with click a button convert it for text
for example:
123 convert to: onehundered twenty two
can any body help me???????????
|
|
|
|
|
Goole[^] could bring up a couple of links.
|
|
|
|
|
i have a problem related to dropdown list...
The texts in the dropdown are too long and the width is not sufficient
to show the entire text. Increasing the width is not an option.Is there
a way to show the list without increasing the width.
thanks in advance
|
|
|
|
|
You may reduce the text length, and only display the full text as the tooltip of the item, the article[^] might give you an idea.
|
|
|
|
|
I have images stored in a folder
I use this path
Server.MapPath("~/Avatars") to find it.
I have a method that grabs all of the file names to display.
It works fine on my machine, and shows them perfectly.
I know I can access it because the code created the image and I have checked the access. Its fine.
I tried typing the URL to the image.
I can see it in IE. So I copy this path to my code. The image is still an X. I have even viewed to source to verify the path. and its correct.
Any ideas?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Once I also had a similar problem and then it was caused that my local machine wasn't case sensitive but the server was case sensitive ...
|
|
|
|
|
Yeah. I wish that was the answer.
Maybe the web hoster blocks images not on the root.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hi
I am using Visual Studio with C# to develope a Web Application. I am using a DataList and binds it to a DataTable. When I run the application and the relevant page loads, the DataList is not displayed. I am using the following code:
private void Page_Load(object sender, System.EventArgs e)
{
string tableName = "Categories";
DataSet ds = categoriesDB.LoadCategories(tableName);
DataList_Categories.DataSource = ds.Tables[tableName];
DataList_Categories.DataBind();
}
The DataSet is holding data because when I bind it to a DataGrid on the same page to test it, the DataGrid displays the data correctly. What am I doing incorrectly or incompletely?
Thanks
Kobus
-- modified at 8:59 Thursday 11th May, 2006
|
|
|
|
|
Hi there. What does the ASP.NET markup of the datalist control look like? Also, you might want to check the Visible property of the control.
|
|
|
|
|
hi minhpc_bk
Thanks. I checked ASP.NET markup and I did not set up the ItemTemplate properly. It displays fine now. I am just struggling to get info out of the DataListItem when I have selected an item in the DataList.
|
|
|
|
|
DepLast = Convert.ToInt32(dt.Compute("SUM(essencbd_amount)","doc_date < '"+DateFormat.strYYYY+"/"+MM+"%' AND totalcode = '"+dsD.Tables[0].Rows[i][0]+"' ")) ;
i write this code but it give a error for this part"totalcode = '"+dsD.Tables[0].Rows[i][0]+"' ")) "
and that error massage is :
Cannot perform '=' operation on System.Decimal and System.String.
|
|
|
|
|
i am not sure but you can check it. normally the below statement returns a string and i think you are trying to add the returned string value to totalcode(probably a decimal).
dsD.Tables[0].Rows[i][0]
so you better to convert the same to decimal as shown below.
Convert.ToDecimal(dsD.Tables[0].Rows[i][0].ToString());
cheers.
Ramesh.Kanjinghat
|
|
|
|