|
Hello all;
I am using Asp.net 2.0 and I want to make form authencation in sub folder admin in my application is the following
- root
- admin
- App_Data
...
so web.config in root folder I have done the following :-
...
</system.web>
<location path ="Admin">
<system.web>
<authentication mode ="Forms" >
<forms loginUrl ="loginAdmin.aspx" defaultUrl ="Default.aspx"></forms>
</authentication>
<authorization >
<deny users ="*"/>
</authorization>
</system.web>
</location>
</configuration>
and give the following error
Server Error in '/Webauthentaction2' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 40: <location path ="Admin">
Line 41: <system.web>
Line 42: <authentication mode ="Forms" >
Line 43: <forms loginUrl ="loginAdmin.aspx" defaultUrl ="Default.aspx"></forms>
Line 44: </authentication>
Source File: C:\Documents and Settings\magic\My Documents\Visual Studio 2005\WebSites\Webauthentaction2\web.config Line: 42
...................
I have made some search and I didnt get proff answer any one can help??
aj123
|
|
|
|
|
Hi,
I am developing one web application in .net 2.0.One page has 3 dropdown list.Drop down values loaded to the database and i need select specific value to the dropdown list.But i got the
"ERROR: Cannot have multiple items selected in a DropDownList".
The coding is below
Me.ddlParam.DataSource = dsParam
Me.ddlParam.DataTextField = "ParameterValue"
Me.ddlParam.DataTextField = "ParameterValue"
Me.ddlParam.DataBind()
Me.ddlParam.ClearSelection()
Me.ddlParam.Items.FindByText("Params").Selected = True
I tried many more ways.but i got the same error.
Pls help
Thanks in Advance
Anand
|
|
|
|
|
Are you resurrecting the value from ViewState and rebinding the columns at Postback. A !IsPostBack check might be missing.
|
|
|
|
|
try this
Me.ddlParam.selectedValue="Params"
Insted of Me.ddlParam.Items.FindByText("Params").Selected = True
Best Regard
Pathan
Plz vote If U got solution
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi,
Can anybody tell me how to generate an assembly from a resource file programatically
Thanks,
Prajin
|
|
|
|
|
I wish to format my gridview in such a way that,
Suppose there is a column "Description", which has been dynamically bound. It may be a 3000 chars long (max). Whatever the case, I wish to display only 2 lines (Approx 200 chars) using DIV tag, while displaying normally. Whenever the user mouseover on it, it should be displayed in the popup and show the detailed (full) content.
I am using export to excel also. Can u suggest any idea?
Jey
|
|
|
|
|
Jay_se wrote: Can u suggest any idea?
Use CSS and javascript
only two letters away from being an asset
|
|
|
|
|
Mark,
Too Generic answer !! ANYWAY thanks. The problem is that, I have been used the Template control& Bind the value to the Label control in the GridView.
Suppopse, if it contains 10 lines, I wish to show only the first two lines. Upon the user explicit request I may display the entire content there itseslf OR in seperate popup window.
You may suggest the outline(in Design). Its helpful to proceed further.
Jey
|
|
|
|
|
"Can u suggest any idea?"
I see, by this you mean, give me the code to do it.
How about we do a little exercise I like to call research. I'll even give you more of a hint. window.popup, style.text-overflow
only two letters away from being an asset
|
|
|
|
|
Mark, Good Morning. Thanks. I would like to learn. I never had the intension to get the code directly from this forum. Since I was worked with C#.Net (Creating BLL classes) for the past 2 years, I am a beginner in design.
Now I am having the opportunity to work in designing of web pages. So I am just learn & do my work. Its interesting too.
Mark Nischalke wrote: window.popup, style.text-overflow
Thanks for the hints.
Jey
|
|
|
|
|
I am using NUnit to test DLL components of a C# web app. All is working a treat except code that accesses the Web.Config file. As the DLL is being run through NUnit and not a webserver, it can't access the web.config file and falls over.
Is there a way I can explicitly tell the ConfigrationManager class to use a specific file to get its config settings? Something like
ConfigurationManager myMgr = new ConfigurationManager("c:\mywebfolder\web.config");
Cheers
Malc
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
1) Install TestDriven.NET, which integrates with Visual Studio,
2) copy the web.config file to MyDLLIamTesting.Config
3) Right Hand Mouse click - Run Tests
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
I ran into something like this a couple of years ago but with App.config. I added some post-build steps to keep everything in synch.
Kevin
|
|
|
|
|
Hi,
Anyone have idea about how to filter file types in asp.net file upload control. So that we ask user to select those files from Dialog box instead of regular exp/java script msg box.
Thanks
suparichit
|
|
|
|
|
I usually just put it through a conditional expression to check the file extension before the upload. Works pretty well.
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
thnq..
suparichit
|
|
|
|
|
Does anyone know where I can get a table or list of the memory usage of various controls?
I'm working on an ASP.NET project & would rather use a label control over a disabled textbox (small water cooler debate). It seems logical to me to assume that a label control carries a smaller footprint than a textbox control.
I'm sure the difference between the two is minimal and not really worth considering, it's really more a matter of curiosity than anything else. I've done a few fruitless searches, thought someone maybe had something more readily available.
Google results for MSDN[^]
More search results[^]
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
Hi
I am trying an application, in that their are two DropDownList controls.Both are to be filled with the XML node items.With the selection change in the first DropDownList, second one should be populate with the corresponing result of the selection one.
I am able to populate two DropDownLists with all the nodes in the XML file but I am not getting the particular selection of First DropDownList.
My XML File is something like this.....
<NewDataSet>
<Table>
<StateCode>AK</StateCode>
<CountyName>Aleutians East</CountyName>
</Table>
<Table>
<StateCode>AK</StateCode>
<CountyName>Aleutians West</CountyName>
</Table>
<Table>
<StateCode>AK</StateCode>
<CountyName>Anchorage</CountyName>
</Table>
<Table>
<StateCode>AL</StateCode>
<CountyName>Jackson</CountyName>
</Table>
<Table>
<StateCode>AL</StateCode>
<CountyName>Jefferson</CountyName>
</Table>
<Table>
<StateCode>AL</StateCode>
<CountyName>Lamar</CountyName>
</Table>
<Table>
<StateCode>AL</StateCode>
<CountyName>Lauderdale</CountyName>
</Table>
<NewDataSet>
All StateCode will be displayed on DropDownList1 and for the corresponding StateCode selection all the CountyNames in that StateCode Should be displayed on DropDownList2,this I am not getting.
Help me out suggest me an example if possible.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
Here is one method you could use:
1.
create a "ListItemCollection" (eg. lstAllNodes) object and populate it with all the pair values (StateCode,CountyName) from your XML (the text should be StateCode and the value should be CountyName).
2.
After that you should do something like this
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string sText = DropDownList1.SelectedItem.Text;
ListItemCollection lstCountyName = new ListItemCollection();
foreach (ListItem lstTempItem in lstAllNodes)
{
if (lstTempItem.Text == sText)
{
lstCountyName.Add(lstTempItem);
}
}
DropDownList2.DataSource = lstCountyName;
DropDownList2.DataBind();
}
Where:
-lstAllNodes is the ListItemCollection object populated with all the nodes like I said at 1.
-DropDownList1 is your first drop down list with StateCodes (be carefull to have it runat server and set AutoPostBack="true" so that the SelectedIndexChanged event may trigger)
-lstCountyName is a second ListItemCollection (it is a temporary object and it's empty at first)
it's used to bind the second drop down list with the required values
-DropDownList2 your second drop down list with CountyNames
Just call me Valy...
|
|
|
|
|
Try this
<br />
function Dataset XMLfile()<br />
{<br />
XmlDataDocument xdoc = new XmlDataDocument();<br />
return xdoc.DataSet.ReadXml(Server.MapPath("XMl.xml"));<br />
}<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
dataset ds=XMLfile();<br />
dd1.datasource=ds;<br />
dd1.datatextField="StateCode";<br />
dd1.databind();<br />
}<br />
<br />
<br />
protected void dd2_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
dataset ds=XMLfile();<br />
datarow[] dr=ds.table.select("StateCode='"+dd1.selectedItem.Text+"'");<br />
datatable tb1; <br />
foreach(datarow dr1 in dr)<br />
tb1.ImportRow(dr1);<br />
<br />
dd2.datasource=tb1;<br />
dd2.datatextfield="CountyName"<br />
dd2.databind();<br />
}<br />
<br />
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi,
Ive created an SqlDataSource on my page using VS2005 (ASP.Net 2.0 c#), that gets infor from an SQL2005 DB as a DataSet. How do i capture / use this data in the codebehind?
I am ok with capturing this data in the CS file when using a DataReader, but for this problem i need to use a DataSet. How do you grab the data in the DataSet, so its rows etc can be counted and used in the codebehind ?
Please help.
Thanks.
|
|
|
|
|
Come on, this is basic stuff - get a book or do some research on the 'net type "dataset" into google for starters) - before asking people here to donate their time to you for free, you really ought to do some work yourself.
Fred
|
|
|
|
|
Yikes!
Friendly!!!
As it happens Fred i spend a heck of a lot of time helping people out in return in various ways and websites. Surely the whole point of a forum is for people to be able to ask questions and share there knowledge with people who are having difficulties.
|
|
|
|
|
munklefish wrote: i spend a heck of a lot of time helping people out
So do I....
Sorry, but your question is pretty general, and with a little research you can find plenty of tutorials and sample code to help you understand your needs already on the net.
I feel that it is incumbent on users to do some research themselves first, and then only ask questions if they are still stuck on particular points, rather than ask other users here to provode them with all the work.
|
|
|
|
|
Frank!
Perhaps you should read my post then. All i need is help in grabbing the data from the SqlDataSource to the codebehind file so i can work with it. This is far from expecting someone to do it all for me.
For example if my SwlDatasource was providing data as a Reader i would use:
SqlDataReader reader9 = (SqlDataReader)<br />
SqlDataSource9.Select(DataSourceSelectArguments.Empty);<br />
<br />
if(reader9.Read())<br />
{ <br />
<br />
Label1.Text = Convert.ToString(reader9["Log_Pass"]);<br />
<br />
}<br />
reader9.Close();
However i need the data as a DataSet, hence my SqlDataSource is set-up via Vis Studio to provide the data as a DataSet. So all im asking is how i get this from the CS file?
If my question is so annoying for you you should have ignored it. However it would have been much quicker, and easier and less time consuming to have answered me rather than wasting your time complaining!
Plus it would have made me happy, and made your self happy having helped someone! I guess your a typical example of the selfish angst society we are living in today.
Thanks for your time!
|
|
|
|