.NET: Understanding Web.config In .net?

Apr 12, 2010

For example, i am using forms authentication... and i notice there is a system.web and then it closed /system.web and then below configuration there are additional location tags.here is an example, if you ntoice there is an authentication mode=forms with authorization i presume this is the ROOT....... It is also self contained within a system.web .... Below this there are more location= with system.web tags....I have never really understand what i am actually doing.. I have tried checkign the MSDN documentation but still i don't fully understand up....

If you notice with my example.... everything is stored in 1 web.config... i thought the standard waas create a standard web.config and then create another web.config in the directory where i wish to protect it..???

<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />[code]....

View 3 Replies


Similar Messages:

Understanding Syntax In C#?

Apr 23, 2010

understand what is going on in the code line below:

Table t = (Table)Page.FindControl("Panel1").FindControl("tbl");
I understand Page.FindControl("Panel1").FindControl("tbl");
Why is there a (Table) before the Page.FindControl?

View 4 Replies

Understanding Of SQL Statements?

Jan 3, 2011

string sqlstring =
"SELECT DISTINCT STAFF_ID, SCHOOL_CODE FROM MODULE_TIMETABLE_STAFF WHERE STAFF_ID != '" +userId +
"' AND STAFF_ID LIKE '%" + Searcht +
"%' ORDER BY STAFF_ID ASC";

can anyone explain this statement for me? especiallythese signs !=,+ +

View 4 Replies

Understanding Asp.Net MVC Framework?

Feb 9, 2011

i am new to MVC and i want to learn it. Please advise me some good material for understanding Asp.Net MVC framework.

View 1 Replies

MVC :: Understanding Binding A Field Value?

Jul 26, 2010

I am trying to make a master - detail form with mvc.

I use ajax tab control for this.

I use MvcContrib.UI.Grid.

[URL]

View 6 Replies

C# - Understanding .resx Variables?

Jun 30, 2010

I am working on a project for my company, and while tracing previously written code I came upon this:

<value>A payment authorization for {0:C} has been received.</value>

What does {0:C} mean? I have been trying to find out and am having no luck.

View 2 Replies

Understanding Special Symbols In .aspx?

Jun 24, 2010

Special symbols are a real pain to learn about because you can't Google for them (try doing a Google search for "<%#" and you's get nothing).

I've been a programmer for many years, and I'm trying to get my head around ASP.net, and especially the "special symbols"; what they mean, where to find out more information about them. Because they're impossible to search for, it'd be wonderful if there were special resources in place to help newbies learn about these.

Specifically, I'm looking for detailed instructions on the porpose for, and use, of the following constructs:

<%@ %>
<%$ %>
<%# %>
<%= %>

What is expected in each, what is allowable in each, and what "gotchas" would a newbie have to be careful for when employing each.

For example, I want to do some coding in a <%# %> block, like:

Text="<%# if (Eval("InUse")) {Eval("ProductName")} else {"Not In Use"} %>"
-- would this be allowable, and if not, what are reasonable alternatives?

View 1 Replies

Web Forms :: Sorting And Understanding Web Page Errors?

Sep 14, 2010

your posts and answers are very informative and helpful in my own devolopment and understanding the nature of the beast. Im running vs2010 on a 64bit windows 7 devolopment machine. For days I have been trying to get a Microsoft Reportview to render in a popup. ( i have done this in vs2008 ). I have tried applying the same code from vs2008 to Vs2010, but am comming up with page erros. When loading the default.aspx ( testpage ) I get 'Done but with errors'. If I click on button 1 which shows the popup, I get the report viewer, but it just sits there 'loading'. From advice givenm on this forum, I have used the IE view source code to try and loacate the problem... but to be honest, I dont understand why the page complies ok, but i get errors when it is run, or indeed how to rectify the problem. I have highlighted the two errors.Ie view source code:

[Code]....

[Code]....

[Code]....

View 1 Replies

MVC :: Understanding With Searchresults And Dropdown Filters In The Same View

Jun 22, 2010

I am new to ASP.NET MVC 2 and I am having a very hard time figuring out how to do even the most simple things. I have a couple of books on ASP.NET MVC as reference but I cannot find any answer to my question. Here is what I basicalyl have and need:

I am trying to create a page that shows me a table that contains some Product Statistics with columns such as Date, ProductCount, PriceCount. On the same page I want to add some filters such as "Product category" (dropdown) and a date from and date to (jquery ui datepicker). When a user clicks on "Filter" it should reload the page and in the Product Statistics it should show the statistics filtered by "Product Category" and the date range. At the same time I want to make sure that the selected Product Category from the dropdown list does not get lost, the same for the date pickers.

I have a GlobalReportController with two actions: "Index" and "Filter". I have also a GlobalReportIndexViewModel and a ReportFilter. In the "Index" action, I retrieve the complete list of statistics and product categories and fill up the ProductStatisticsIndexViewModel.

I am having a whole lot of problems trying to grasp how the ASP.NET MVC paradigm works exactly.

View 8 Replies

C# - Understanding Regular Expression For Number Range

Jan 26, 2011

I'm trying to build up some regular expressions to validate some textbox controls. I have done some research and testing but cannot get this one working. Examples of what i am trying to create regular expressions for are as follows:

Range 0-45, 0 decimal places
Range 0-20, 2 decimal places
Range 16-65, 0 decimal places
Range 0-99, 2 decimal places
Range 0-1500000, 0 decimal places
Range 0-200, 1 decimal place

For 1 and 5 respectively, I have used

([0-9]|[0-9]d|45)$
([0-9]|[0-9]d|1500000)$

The first one I am having problems for is an age range of 16-65 (inclusive), where I want no decimal places. After a post on here (Regular expression to allow numbers between -90.0 and +90.0) I thought I could use the logic and get it sussed, but can't! The expression I got to was:

(d|([1-6][6-4]))|65

View 2 Replies

MVC :: Understanding The Normal Flow Between Multiple Controllers (1.0)?

Sep 8, 2010

I am building a medium to large application with ASP.NET MVC 1.0 (we'll upgrade to the latest after we meet some schedule commitments). The application contains a number of workflows, with a separate controller for each workflow, and the home controller owning the main page of the application. So, I end up with the home page, on which the user makes selections and then clicks one of a number of action buttons to proceed down a given workflow. For a given workflow, I seem to have the following flow between controllers:

homeController (home view) --> action-button --> workflowController --> homeController (completion view)

I figure the action-button does a post to the home controller, which the selections the user made are saved to session state in the appropriate model. The workflowController will handle things as the user moves through one or more views specific to the workflow, but then things end on a common completion page.My question(s):1 - Is this a reasonable way to break up responsibilities amoung multiple controllers?2 - How do I actual accomplish the hand-off to the workflow specific controller? I'd really like to avoid a redirect and the attendent round trip to the browser since controller structure is really an internal implementation issue and shouldn't impose a performance penalty on the user.3 - Is it possible to pass a model from the originating controller to the destination controller, or do I have to exclusively depend on persistent state to pass things to the "next" controller?

View 1 Replies

State Management :: Understanding ViewState And Hidden Fields?

Aug 8, 2010

If I create a new project, start this project and look at the source code, I see that there are some additions to the original code. The first this, what is "ViewState" and what does the hash mean? Why is the input control hidden?Here an example:

[code]....

View 3 Replies

State Management :: Understanding The ViewState Lifecycle On An ASP.NET Form?

Aug 5, 2010

I have an ajax form that has a simple click event. Inside the click event, at the end of the method, I have a Response.Redirect back to the same page. For the purpose of this thread, I will leave out the reasoning of this (it is just something that I had to do). Once the ajax call is complete and the redirect takes place, all of my default control viewstates get wiped out. The thing that doesn't make sense, is that if I define my own ViewState right before the Response.Redirect, these ViewStates also get wipedout. So, my question is, do ViewStates only hold their values after one postback/refresh? And, is there a way to use ViewState with the method described above? I am being forced to use the querystring to pass parameters.

View 2 Replies

Web Forms :: Understanding App_Code Related Error CS0121?

Nov 9, 2010

I've searched for about a day and a half and have not been able to find an explanation that I can understand, so please forgive me if this is something you have seen/answered before.

I have a web site that uses the App_Code folder. There are several CS files and classes in that folder. All of this works fine up to this point. However, I wrote an extension method with its own class and file. This fails with the following ambigous reference error (the app is in C#):

Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties: 'GSGeneral.ExtensionMethods.IsNumeric(string)' and ''GSGeneral.ExtensionMethods.IsNumeric(string)'

If I change the extension to a plain static class, there are no problems with it. Based on that, it seems like this is related to it being an extension method.Now I know a work around is to move the file out of the App_Code folder - I've tried it and it works. My question is why does this have issues when all of the other items in the App_Code folder do not.

View 9 Replies

Forms Data Controls :: Understanding Dropdownlist Within A Repeater Control

Sep 26, 2010

Asp.net 3.5 using code behind I am using a repeater control. My datasource appears in code behind. I decided to NOT have my listitems populate from the database. I want the user to select a value, send it to the database via an update statement, and then when the user returns to the page (on pageload), have the user's previous selections appear on the screen. note the following:

When I use textboxes and labels, ALL of my data appears within the table of the repeater control. However, when I replaced one of the text boxes (originally used for testing purposes only) with a dropdownlist, I get the following error message'ddlDDuring' has a SelectedValue which is invalid because it does not exist in the list of items.Parameter name: value My Repeater1_ItemCommandI updates the data within the repeater perfectly. On page load, I want the data from the database to display as the dropdownlist's selected value (or selected item.text). Here is my Asp code

<asp:Repeater ID="Repeater1" runat="server"
onitemcommand="Repeater1_ItemCommand">
---
<
td><asp:Dropdownlist ID="ddlDDuring" runat=server SelectedValue ='<%#Bind("DueDuring")%>' >
<asp:ListItem Value="-select-" Text="-select-" />
<asp:ListItem Value="1st half" Text="1st half" />
<asp:ListItem Value="2nd half" Text="2nd half" />
<asp:ListItem Value="Split" Text="Split" />
</asp:Dropdownlist> </td>
---
C# code behind
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
---
string myConnectString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
myConnection = new SqlConnection(myConnectString);
strSelect = "SELECT * FROM UserExpenses WHERE UserId=@UserId";
mySqlCmd = new SqlCommand(strSelect, myConnection);
myConnection.Open();
mySqlCmd.Parameters.AddWithValue("@UserId", LoggedOnUserId);
myReader = mySqlCmd.ExecuteReader();
Repeater1.DataSource = myReader;
Repeater1.DataBind();
myReader.Close();
myReader = mySqlCmd.ExecuteReader();
while (myReader.Read())
{
ExpAmount = Convert.ToDouble(myReader["Amount"]);
TotExp += ExpAmount;
---

I tried the following code changes on asp page: I changed "SelectedValue" to "Text" and still get the same error message I changed "SelectedValue" to "SelectedItem" and don't get the error message, but dropdown is not populated I set AppendDataBoundItems = true Set first list item value = "" Verified that every field in the table column matched the items in the dropdown list. There were NO null fields in the database.

I just want to understand this error message, as I have exhausted all that I am doing. I also made an attempt to bind the dropdown list, but sine this can only be done within the loop of finding the repeater control, I would either get an error message, or it just would not work.

View 6 Replies

State Management :: Apparently Missing Something In Understanding Of Session Handler

Aug 24, 2010

It was doing exactly what I expected until I added more than 1 property to it. It seems if I set the value of a property this, in turn, sets every property in the handler to the same value.

I figured it had something to do with the "shared" but if it's not shared then I would have to declare an instance on my page which would kinda ruin the state of my variables (otherwise, I'd just put them all in my class), right??

[Code]....

View 2 Replies

C# - Fluent Control Writing Like Telerik - Understanding The Angle Brackets Translation

Nov 8, 2010

public class OneControl
{
...
public OneControl Content(Action value) {
ContentProperty = value;
return this;
}
public void Render()
{
ContentProperty();
}
...
}

Then I got this in my view :

<div id="pleaseHelpMe">
<% OneControlInstance.Content(() => { %>
Some Mixed Stuff <%= Example%> Euros
<% }).Render() %>
</div>

I would like to use this syntax in my UI library, I know how to implement this but I don't know HOW it actually works! I understand that somewhere and somewhat a delegate is created and provided as an argument of the method Content, but can't find any information about this mecanism or technic. Assumed current correct answer : The compiler translates the aspx code below into (symbolic translation for comprehension):

<div id="pleaseHelpMe">
<% OneControlInstance.Content(() => {
ViewPageInstance.Response.Write("Some Mixed Stuff ");
ViewPageInstance.Response.Write(Example);
ViewPageInstance.Response.Write(" Euros");
}).Render() %>
</div>

View 2 Replies

Visual Studio :: Errors In Root Machine.config And Web.config After 2010 Installation

Jan 19, 2011

I just installed VS2010 and opened the root machine.config and web.config files for review and I found some errors. In machine.config, the following line has errors in both entries for <Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior>. When I hover the cursor over them I get a tooltip text which displays: "The element 'endpointBehaviors' has invalid child element 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior'. List of possible elements expected: '...(list of options here)...'. The same problem happens for the second appereance in tag <serviceBehaviors>.

[Code]....

In web.config, there is a tag called <protocols> that has an error with a tooltip text that says "The element 'system.web' has invalid child element 'protocols'. List of possible elements expected: '...(list of options here)...'.

View 2 Replies

How To Create A Common Web.config File And A Bunch Of Specific Web.config Files

Feb 16, 2011

Currently, I work on an ASP.NET project which is hosted under version control and is used on several developer machines, tester machine and production environment.

In three cases, configuration (Web.config) may be different. For example, developer and tester environments use testing SQL Server, whereas in production environment, another SQL Server is accessed, so the connection string is different in those cases.

We want to keep three versions of Web.config in subversion. But modifying each of three files every time we need to add, remove or change a common setting is annoying: it would be nice to have a common, master Web.config, which will be inherited by each of the three Web.config files.

How to set up an ASP.NET project which will use a master configuration file and different slave configuration files on different machines, thus sharing the same project/source code/configuration files in subversion?

View 2 Replies

How To Determine Which Parent Config File Is Locking A Web.config Setting

Mar 15, 2011

When I open my ASP.NET site in IIS and try to open the .NET Trust Levels, I get an error message:

.NET Trust Levels There was an error while performing this operation.

Details:
Filename: ?C:inetpubwwwrootmyappweb.config
Line number: 445

Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"),or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

I've checked a few places, but I haven't found anything that seems like it would be locking that setting. Is there a systematic way of determining where that setting is locked?

I'm using IIS 7.5 and .NET 3.5 sp1.

View 1 Replies

Unable To Read Config Settings From External Config Files

Sep 1, 2010

We are experiencing some strange behaviour on one of our ASP.NET web servers (Windows 2003 64-bit). After some activity, two third-party controls are unable to run correctly. One is log4net (it does not write error messages out) and the other is a menu control (it displays eval message instead of picking up its license). The one common thread is that both controls pick up their config from external config files (linked to from web.config).

Just wondering if anyone has any thoughts on this or experienced this in any way. Is it related to file/folder rights? The server has been running fine for a while and just started exhibiting this behaviour. Perhaps it occurs around the time the worker processes are recycled.

View 1 Replies

Child Web.config Can't Clear <pages><controls> From Parent Web.config

Apr 13, 2010

How can I "clear" the vendor defined <controls> in my child app's web.config?

Parent Web Config.

[code]....

I have it working for the <tagMapping> section, but <controls> does not support <clear/>.

View 2 Replies

C# - Command Or Setting For A Child Web.config To Ignore The Parent Web.config

Jun 23, 2010

I am running into a problem with a web.config in a child project that has the same connection string setting as a parent. We have this in several of our web apps but there is one case where we want a child not to use the parent web.config. Is there a setting or command in the child web.config to ignore the parent web.config?

View 4 Replies

Configuration :: Deploy Web.config And App.config Connection String?

May 3, 2010

I have deploy my web site, it contains a project!

in MyWeb there are all the aspx page and some entites datamodel, in MyApp there are the class with function like "getter data from DB" and there is a entity data model.

afeter the deploy, I have only the web.config and the connection string for the entity datamodel....itīs run ok, read/write the data on the DB.

The problem is with MyApp.....after the deploy it is a dll file and I donīt have the app.config and the entity inside it donīt run, not read/write nothing on the DB.

There arenīt error or messager but not read/write the data in the MyApp project.

all run on the iis 7

now...the question is:

I lose the connection string (in app.config) after the deploy?

Can I put a entity in the MyWeb and read it in another project (myApp)?

ps: for connect to DB I use not the c# code:

var db=from x in AccessDB.Example select x;

View 1 Replies

Machine.config / Web.config In .NET Framework 3.0 / 3.5 And Framewor 1.1 / 1.0 Cascade?

Aug 9, 2010

I made a change in my machine.config for a 1.1 application and then later I upgraded the application to .Net Framework 3.0/3.5. Will that configuration change still apply or do I have to make that change in my local web.config for the 2.0 machine.config/web.config?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved