asp.net

Popup after updatepanel postback is blocked by popup block

I make a polling and want to popup the result immediately by window.open function after partial postback (updatepanel). But the popup is blocked by popup blocker. How can I fix it? Here is my code: protected void btnPollingSubmit_OnClick (object sender, EventArgs e) { UpdatePolling(); } protected void UpdatePolling() { // upda...

VB.NET Custom Errors Messages

...

Which exception to throw when not finding a WebForms control which "should" be there

Hi! We have a WebForms Control which requires that the ID of another Control implementing ITextControl is provided. What exception should we throw if there is no control with that ID or a control is found but it's not implementing the interface? var text = Page.FindControl(TextProviderId) as ITextControl; if (text == null) { throw...

HttpContext.Current.User.Identity.Name with and without www

Hi, I am writing a web service in vb.net/asp.net 2, that needs user's name. It works fine when the url request is "www.mysite.com" but if any one has logged-in using "mysite.com" without a "www" and goes to the page that calls my web service, The HttpContext.Current.User.Identity.Name gives null. How can I resolve this problem? Many ...

How to use asp:placeholder inside a repeater

I have a HTML table that is built with a repeater. Sometimes the table has 5 rows, sometimes it has 8 rows. It was easy to add the header rows. <asp:PlaceHolder runat="server" ID="additionalHeaderColumns" /> In code behind I added controls (htmlheadercells) to the contentholder: Dim tableHeaderCell As New TableHeaderCell() ...

ASP.NET CMS - which one?

Hi We have a lot clients with CMS requirements. We use Telerik Sitefinity, which is pretty easy to use, but before we implement a whole swathe of new apps, I just want to double check we are going the right way? Telerik is a reliable company. I am not interested in "free" CMS products that will probably disappear a few years down the...

Generate Sitemap from URLs in Database

Problem Statement: URLs are stored in a database, example: home/page1 gallery/image1 info/IT/contact home/page2 home/page3 gallery/image2 info/IT/map and so on. I would like to arrange the above urls into a tree fashion as shown below (each item will be a url link). The final output would be a simple HTML List (plus any sub list(s))...

Pass collection of enums to ASP.NET MVC ActionMethod

Is there a way to pass a collection of Enums to an ActionMethod (on a GET) automatically? For example, if I have the following enum definition: enum DaysEnum {Sat, Sun, Mon, Tue, Wed, Thu, Fri}; and, I have an ActionMethod definition of: ActionResult SampleActionMethod ( List<DaysEnum> days) Is there a way I could render, in a Vie...

problem in ScriptManager.RegisterStartupScript

my code- else if (responseEntity.Messages[0].Description == ResponseMessages.DUPLICATE) { ScriptManager.RegisterStartupScript(this, this.GetType(), "javascript01", "hide('tblProductGrid');"); ShowDuplicateRecordAlertMsg("PROD", "Product"); txtAddProductName.Enabled = true; } private void ShowDuplicateRecordAlertMsg(string...

google maps in aspx

Hello! i've tried to integrate the first example of google maps (http://code.google.com/apis/maps/documentation/javascript/tutorial.html#HelloWorld) in my aspx 4.0 project and it doesn't seem to work . Is aspx creating a problem (doesn't accept google maps) or am i doing something wrong? Regards, Alex Badescu ...

Strategy for Caching Previous Searches (ASP.NET)

Hi Guys, I have an ASP.NET MVC 2 Web Application (.NET 4, C#), where user's can search for locations. The page is implemented with an auto-complete box, similar to many websites. (Google, YouTube, etc) Now, the AJAX call to the server results in a Stored Procedure call to the database. (whilst efficient, could result in a lot of round...

Getting value of properties of dynamicly created controls in asp.net

Hi! How I can determinate width of some asp.net control, that was created dynamicly? For example I have such code: <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <encosia:HighslideManager ID="HighslideManager1" runat="server" FadeInOut="true" OutlineType="RoundedWhite" ControlBar="false" /> <ta...

web.release.config change dynamic webservice url

I'm editing my web.release.config file for production. I want the web.config file changed after a publish. I found how to change the web.config by using the web.release.config file properly, but not for this particular component. The URL of an dynamic webservice has to change. In the web.config: <applicationSettings> <FooService.P...

How do you set href attribute of anchor tag that is within a repeater in code behind?

normally on would use the following :- aspx page:- <a ID="a1" href="javascript:void(0);">Link1 </a> code behind:- a1.HRef="www.mySite.com/mypage.aspx"; how do u set this HRef attribute in case the anchor tag is within a repeater ? ...

intranet colaboration system

I would like to give our intranet users and create, edit, colaborate documents via a browser. What is the best way to go about this? Requirements: The user should be able to: 1. create content, 2. edit content (content created by anyone) 3. records should be kept on who edited what and when 4. should easily be able to go back and forth...

asp.net SHGetFileInfo[winapi call]

Hello. I need tree file at my asp.net site. For getting icons I try use SHGetFileInfo api function. At non asp.net application it works well, returns corrects Icon. When I conusme it at asp.net context I got: Attempted to read or write protected memory. What's wrong? Can I get fiel icon at asp.net context? Code: public class Extra...

File export not working in Update Panel

Hello Everyone I am trying to export a file upon button click event. The structure of my app is like this. UpdatePanel TabContainer Tab1 UserControl (Button is in UserControl) Tab1 TabContainer I tried setting PostbackTrigger but it says control not found exception. Thanks in Advance ...

Grid view - Column

Hi all.. I am creating an application in asp.net..I used a grid view to show the datas .. By using the autogenerate columns I bind the datas to the gridview.. Now i want to make a edit button at the end ..By clicking that the user can edit their details ... But i need to count the number of columns in a row to make a pop up...

ASP.Net handler request stack

I've got a slightly odd requirement that I'm not sure how to properly articulate. I essentially want to prioritise the most recent requests to an ASP.Net handler. I'm not sure if this should be client-side or server-side. I'm leaning towards server side to ensure it's enforced on all clients. So, as requests come in, they're essentiall...

How to get the screen resolution of android devices in c#

I'm creating a optimized web page for mobile devices with C#. Is there a way to offer a page for larger screens and one for smaller screens on android devices? With Apple i can differentiate between iPad and iPhone, but how can I do this with the galaxy tab or a regular android phone? I don't want to use any javascript in this case. ...