asp.net

how to get the id from /controller/action/id from within a view page?

From inside a viewpage, how can I reference the id from the url /controller/action/id without getting this data from the model? ...

ASP.NET CustomErrors ignores when a dot before slash is in url

Hi all, we have configured customerrors, so when we do this: http://oururl.com/webDoesNotExist/test.aspx the custom error page is presented, but when we do this: http://oururl.com/web./test.aspx we get an 404 from asp.net runtime any idea how we can redirect to custom error in this case? greetings, Tim ...

Changing resources without recompiling project - ASP.NET MVC

I am looking for solution to a problem that I am having with resource files within ASP.NET MVC, I have tried a few different options in attempts to get this working but have so far been unsuccessful. The desired configuration would be one where I can make resource files available for editing after a deployment. The solution we are putti...

asp.net build tool which can build a web app into multiple dlls?

I have a large solution which has multiple apps which all share some common site elements (masterpages, navigation, etc). Currently, all of these get built into a single DLL If my structure looks like: WebRoot - Common/ - Shared/ - Images/ - App1/ - App2/ - etc Is there a build tool which will allow me to build WebRoot.dll, Ap...

Biggest advantage to using ASP.Net MVC vs web forms

Possible Duplicate: MVC versus WebForms What are some of the advantages of using one over the other? ...

ASP.NET Applications - Development with thunder fast speed

. Dear All, We are working on ASP.NET applications development (in different domains). Management is expecting the applications development with thunder fast speed. They are not much bothered about the code quality. So in this case, could any paid/free software/plug-ins/modules can help us? If so, could you please pr...

ASP.Net - A potentially dangerous Request from submitting HTML data

Hi, I'm working on a web form which works in a following way. Read email template from database Display email template on a web form in HTML format User adds additional information to the web form and clicks on submit button Before I get to a method which will process that request, I get A potentially dangerous Request.Form I have l...

set background color of all textboxes (input fields) to transparent

I am upgrading part of a very old website. One of the pages that I own uses controls and dlls that I do not. There is one dll that puts a textbox (input field) on the page. This field is concepually a label but the person chose to use a textbox. Anyways, I can't change the dll. Is there a way in my asp.net page that uses the dll to say ...

DataType vs UiHint

I have been using mvc2 for a while now, and when i need to set the template i use the DataType Attribute [DataType("DropDown")] public int Field { get; set; } I see others using UiHint to achieve the same results [UiHint("DropDown")] public int Field { get; set; } What is the difference between using these two a...

How to return selected items from checkboxlist control in asp.net

I am trying to return in a string the selected items from a dynamically bound checkbox list control with no luck. I'm hoping someone can help. In my code behind file I am conencting to a class called users and building a datatable. I then bind the data table to the cblist control private void populateUserList() //called on page ...

Can we change the font size through code behind?

I need to change the font size of bold thing below. I have a css for use but this bold part needs font changed to 8px instead of 10(css). i want someone to help me with how to change in Code behind. string newpackname = dschkdowngraded.Tables[0].Rows[0]["ChangedTo"].ToString(); DateTime dt = Convert.ToDateTime(dschkdowngraded.Tables[0]....

My <% %> not working in div. Why?

I've tried both snippets below. Nothing. I've tried <%#, <%=, and <%. Nothing. So I'm stuck. <div style="background-color:Gray; color:white; text-align:center; width:100%;"> <asp:HyperLink ID="HyperLink1" Target="_blank" NavigateUrl='<%= Server.HtmlEncode(String.Format("~/ShowHistory.aspx?section={0}&jobnumber={1}", "APQP ...

HttpWebRequest is throwing exception for 404

Hello guys. I've found that HttpWebRequest is throwing WebException for not existing resources. It seems to me very strange as HttpWebResponse has StatusCode property (NotFount item exist). Do you think it has any reasons for that or maybe it is just developers issue? var req = (HttpWebRequest)WebRequest.Create(someUrl); using (HttpWeb...

ASP.NET Treeview Image background

I have a tree view control that I would like to supply the background image for. My code currently looks like this: <asp:Image ImageUrl="~/images/mypic.gif" runat="server" Width="150px" /> <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" ImageSet="Arrows"> <Paren...

Session variable getting lost?

Given this Global.asax.cs: using System; using System.Web; namespace Foo.Web { public class Global : HttpApplication { private const string IntroductionPageShownSessionKey = "IntroductionPageShownSessionKey"; protected void Application_AcquireRequestState(object sender, EventArgs e) { ShowIntroductionIf...

How to dynamically change master page's master page?

I am trying to change the master page dynamically, and although it's easy to do from a content page (overriding OnPreInit), there is no such event for a master page. Is it possible to introduce this event somehow? UPDATE: I got halfway there by going via the PreInit of the pages at the bottom of the ladder, turns out you can do things ...

The full-text query parameter for Fulltext Query String is not valid

I am using Full Text Search with LINQ in my application and as this is not supported by LINQ I use a table-valued function workaround. The function is created on SQL Server 2008. Surprisingly, I get error “The full-text query parameter for Fulltext Query String is not valid” when I search for a simply text e.g. “manager” I used SQL Ser...

@Password for aspnet_Membership_CreateUser

Application : Nerddinner. This SP is for an inserting password for newly created User. I was trying to figure out where the @Password come from in the application code since it is provided to this SP. I looked for it on application level, but I could not find it on application level. Does anyone know where the SP is used in the applica...

svn folder structure organization

One of my web apps has grown over the past few months from a single project file to include several class libraries. The svn structure has sort of grown organically and looks something like this: repository-root site1 trunk tags site2 trunk tags library1 trunk tags ...

Is there a reason that ASP.NET's CheckBoxList doesn't have a SelectedItems member?

Whenever I want to get selected items I have to loop through each item and see if it's selected. They even have a SelectedItem (no "s" at the end) member which seems odd for a CheckBoxList. It seems like a logical thing to have, does anyone know why they haven't added it? ...