asp.net

Why would one keep several different "displays" in a single page, rather than separate different views in their own page?

When and why would it be a good choice to keep the view of two different sets of information on the same page, and just change what's visible depending on different parameters? For example, an application I'm working on has three levels of users: Admin, Director and Project Manager. We have a Managers.aspx page which follows this flow ...

Peculiar problem

Let's say I have a DataTable: DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Country", typeof(string))); dt.Columns.Add(new DataColumn("State", typeof(string))); Now I populate it DataRow dn = dt.NewRow(); dn["Country"] = "1"; dn["State"] == "2"; // Add it dt.Rows.Add(dn); That works fine. Now if Country and State ...

I want to break my text into two parts - asp.net

Here's the problem: I have couple of pages which gets its content from a database. The content is displayed in a Literal control kept on an asp.net page. The article sometimes gets quite long so I want to break the content into two parts using a client script. Unfortunately I cannot change the query to pull data partially. The entire d...

How can I read in C# XML from another page while logged in to the site

I have logged in to the site with my webbrowser and whenever I try to call WebClient myWebClient = new WebClient(); string str = myWebClient.DownloadString("http://localhost/myxml.aspx"); Response.Write(str.ToString()); Or XmlTextReader reader = new XmlTextReader(url); while (reader.Read()) { Response.Write(reader.ReadOuterXml()); ...

Returning a value on exception

Why does this code not compile? It gives me the error: not all code paths return a value Code: public bool isUserProfileHashed(string username) { bool isHashed = false; MembershipUser u = null; u = Membership.GetUser(username); if (u != null) { try { u.GetPassword(); ...

Calling a method for a user control in a repeater?

I have a user control that when a method is called dynamically adds images to an asp panel. I have placed this control in a repeater. I am using the following code to call the function. I have tried calling this function on page_load, databinding of the repeater, databinding of the item, and oninit. foreach (RepeaterItem repit in r...

How to get a reference to a non-default ProfileBase in ASP.NET?

I know I can get a reference to the default Profile in ASP.NET with code like this: ProfileBase p = ProfileBase.Create(username); (I know there is also HttpContext.Current.Profile, but that is for the current user, and I need to get the profile by username.) The above code works only for the DEFAULT provider as defined in the default...

Can't update items in parent page using loaded child page.

Hey guys, this is more something like "what to do?" than a question in fact... here it is: I have a page in which users can execute selected services.. each of these services are different full .aspx pages (there's a lot of them). the page is divided in 3 sections, as you can see in the picture: Panel A: lists the selected services...

ASP.NET application not loading javascript

I am developing an application on my win XP box. I use visual web dev to run the app interactively but I have also set it up on IIS for testing from another machine on my network. This all worked perfectly until... Microsoft had a high priority update in the form of IE8 and after the update failed to reboot. After a silly amount to t...

MVC - Insert data into multiple entities from same page

I have a single page which collects related data into a series of input fields. When the user clicks submit I want to insert the data into two different database tables in one go. ie I want to get the primary key from the first insert, and then use it for the second insert operation. I am hoping to do this all in one go, but I am not s...

User Control with Input Parameter - ASP.NET

I have a user control with property (*.acsx.cs): public partial class controls_PersonAccessStatus : System.Web.UI.UserControl { public Person Person { get; set; } protected void Page_Load(object sender, EventArgs e) { } } Is there some way to pass parameter to this control in *.aspx, something like this <% foreac...

FireFox "XML Parsing Error" with Hello World WebSite!

Hello I get the following problem when trying to open an ASPX page in FireFox: "XML Parsing Error: no element found Location: http://localhost/FrameworkTest2/Default.aspx Line Number 1, Column 1:" This site works fine in IE. To get to the root of the problem, I removed all code and built a "Hello World" page instead. This works in I...

Can Failure to Access the URL in an XML Schema or Document Cause my Application to Fail?

I'm usng this: http://schemas.microsoft.com/cdo/configuration/smtpauthenticate The schema is down? My software doesn't work anymore. Gives me a message: Can't access to CDO Message. I'm using Framework 1.1 with mail send authentication and failed. Anyone have solution? ...

Localization of attribute values in .NET

How can I localize/internationalize attribute values in .NET? My specific example is for ASP.NET web parts such as WebDisplayName, WebDescription, etc. where I inherit from the base class that uses these attributes. Also, is there any difference to doing this with attributes declared in my own classes? Thanks! ...

How do I force ASP.Net to invalid (and thus reload) the current application instance?

Basically I want the effect that would occur if I were to edit the web.config file. The application basically completely unloads itself and starts again, thus re-firing Application_Start and also ditching any dynamically created Types created by the now-defunct AppDomain. EDIT I need to do this in my C# code inside my web application. ...

Is it possible to know if the type of the uploaded file is an image?

While user uploading a file, is it possible to know if the uploaded file is an image or not, I am open for any solution, Client Side, Server Side or both and we choose based on the case. ...

xlinq throw null data? how can i solve it?

Hello again; i try to save xml data from xml file. How can i do that? if i use below codes, XmlStream return null "throw null". How can do that? my data: <list> <subscriber Type="Random"> <name>yusuf</name> <surname>karatoprak</surname> </subscriber> </list> public static XDocument GetRawsSnippetAsXDocuments() ...

change .aspx to other like .abcd with rewriteModule

hello all i want to change .aspx to like .abcd with rewriteModule in asp.net and iis7? therefore when user typed home/default.aspx must be redirect to home/default.abcd please help me excuse for my weakly english writing thanks all ...

Custom Routing Rules (e.g. www.app.com/project/35/search/89/edit/89)

I would like to create routing rules like the following: www.app.com/project/35/search/89/edit/48 ---> action is edit in the project controller The passed variables should be project# (35), search# (89), and edit#(48) Can someone help me structure a routes.MapRout() for this. I want to use: routes.MapRoute( "Default", ...

how execute SSIS Package on SQL Server 2005 in javascript code???

Hi! I need to execute an SSIS Package on SQL Server 2005 but programing them using the javasript code for a page web. Anybody can help me please?? Thank you! ...