asp.net

Problem with fileupload only allowing images

<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ErrorMessage="Only images are allowed!" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*)) +(.jpg|.JPG|.gif|.GIF|.png|.PNG|.jpeg|.JPEG)$" ControlToValidate="fileUpEx"></asp:RegularExpressionValidator> ...

connect two ObjectDataSources

I need to connect two ObjectDataSource tags. First will have a query string parameter and the second has a parameter, which is one of the fields in the result set of the first one. The relationship is one-to-one, so I can't put second one in a grid and use control parameter <asp:ObjectDataSource ID="OrderObjectDataSource" runat="server"...

Handle errors when databinding a query parameter to a datasource?

How can I handle errors when I use databinding to databind a query parameter to a datasource control? I have 3 questions: How can I validate that the query string data is correct before it is bound to the datasource? How can I handle errors when the data is in the correct form but an error is generated from the database? Is it safe ...

ASP.net Ajax issue

I am working on an asp.net web application which uses a fair bit of Ajax - nothing too complex just update panels and the controls from the Ajax Toolkit. Prior to being handed over it was using Ajax 1.0 and was then upgraded to work on the 3.5 framework. The toolkit controls were replaced by the correct version and I can create a new p...

asp.net Session variables inside of SharePoint

Hello, So, here is a problem that I am having with asp.net app inside of SharePoint (as page viewer). When the Default page is loaded, it works fine. However, when I try to go to next page, i am getting a null reference exception. It looks like my session variables are becoming null on the next page (even though I set them on the pre...

Handle webservice in asp.net

Hi all expert, While client application call the web method with invalid username or password. Client application should get the message like "Access is denied". How can automitcally client will get the message...pls help me....here is my webmethod code: [WebMethod, SoapHeader("spAuthenticationHeader")] public DataSet GetCustList() ...

Update page after file download

Hello! I put together a download script after some wonderful help from stack overflow the other day. However I've now found that after the file has been downloaded I need to reload the page to get rid of the progress template on the aspx page. The code to remove the template worked before I added in the download code. Code to remove ...

Implementing "Preview" functionality in asp.net mvc

Hi All, I am using ASP.NET MVC and jquery. I would like to implement preview functionality to a form. i.e. I have a form with number of fields for example name, address etc.. Before the user submits the info, he/she can preview it as to how it will appear on the site. Could any one please point me to right direction as to how I could im...

Visible Checkbox only on Gridview's last row?

Is it possible to have a Checkbox that only shows up when Editing the last row of a GridView? I have tried something like this in the EditItemTemplate: <asp:CheckBox ID="chkNextDay" runat="server" ToolTip="Is it a next-day departure?" Enabled="true" Checked='<%# DateTime.Parse(Eval("OutHour",...

XML and XSLT to generate CSS ?

I want to provide user facility to change the CSS. First think clicked is that storing CSS as XML will help me read CSS and understand. Second is that using XSLT i will be able to generate the CSS (am i right ? will that be useful) Lastly when user changed the CSS XML file can be updated and then it can be used. Now this is at very r...

Identify callback control id

I have a masterpage that contains a user control. The usercontrol uses callbacks for various operations. However, every time a callback is issued from the user control it is propagated down to the pages that inherit from the master page. How do I determine the id of the control that issued the callback so that I can stop these callbac...

Unable get Label.text in ASP.Net Repeater using FindControl

I can access the text within a textbox within my repeater, but I am unable to pull the text value from a label within my repeater. The repeater is populated from a datatable with row(x) being filled by sqlreader(x), I don't know if that makes a difference. I cannot use javascript for this. I need to access the label value from the codebe...

asp.net role provider- get users email address?

i am using role provider and have it managing users on my intranet via their windows logins. how can i pull their email address and maybe some other user content from asp.net using their user info? do i need to hook into active directory? a sample fir this would be great if this is the way to go thanks all ...

How to order a list

Hi, I have a function in sitefinity that returns a list of categories. //return list of categories private IList<ICategory> GetCategoryDataSource() { var cntManager = new ContentManager(CaseStudyManager.DefaultContentProvider); IList allCategories = cntManager.GetCategories(); List<ICategory> filteredList =...

Visual Studio 2010 ASP.NET 4.0 WebForms Routing Not Working in IDE Debug Mode

Greetings, I am using Visual Studio 2010 and ASP.NET 4.0 to build a WebForms project that uses the new routing features in System.Web.Routing. When I build my solution and run it from within VS.NET's debugging environment only routes with RouteUrl's that include a ".aspx" extension are being properly routed to the PhysicalFile. It app...

WebService Debug Synchronization (why do my breakpoints give the message "The source code is different from the original version"?)

I'm fairly new to web service development, and I am really confused about how ASP.Net Development Server synchronizes with code during debug mode. When I make changes to my service, I cannot figure out how to propigate those changes so that my client can "see" them (I've been able to synchronize through a stumbling series of publishin...

Does the Mobile Device Browsing File live on?

According to http://mdbf.codeplex.com/: "Due to the organizational restructuring of the team that developed and supported the Mobile Device Browser file, we will no longer have the resources to support and update this CodePlex project. The team will be providing two more releases – one on the 27th July 2010 and the final release on the...

Databinding two sql tables to one repeater

Hi, I'm very new to using Linq-to-SQL, that's why I'm asking this question. I've searched the site, but can't seem to figure out how to do this. My problem is: I have a database mapped with LINQ to SQL: Table 1: PersonalTasks TaskId Header [Content] IsDone CreatedDate Table 2: Comments CommentId TaskId UserId Comment CreatedDate ...

asp.net datalist data binding

I am using an asp.net/c# datalist. <asp:DataList ID="EquipmentList" RepeatColumns="5"..... I have the following line inside the <ItemTemplate> tag: <a href=""><%# {I want to put something here but dont know how} %> </a> In my code behind I have a NameValueCollection variable that contains all strings: NameValueCollection myListo...

Making a treeview with expandable childnodes

I'm having trouble with a treeview, in ASP.NET. I'm basically querying a database table. 3 of the colums are important Name Id ParentId So this amounts to a bunch of Nodes in the TreeView, some which will have Child Nodes, Child Nodes may have more Child Nodes themselves, etc... Top Nodes don't have a ParentId, they are set to null,...