asp.net

ASP.NET Membership Provider authentication not working authenticating WCF Service

I have a SqlMembershipProvider store with Roles enabled. This is configured and has the user "devtest" in the roles "xxUser" and "xxAdmin". I also have a WCF service, which I want to authenticate and authorize against. My problem is that: the authorisation is not happening, code just executes despite the policy attribute I don't get ...

How can i create dynamic buttons on button click event (C sharp ASP.NET)?

I want to create dynamic buttons on button click event(for example., btnCreateDynamic_Click). I tried creating dynamic buttons on page_load event and Pre_int event.They are all working but i want to create them in button click event. How can i do this in c# asp.net? ...

Protect files with asp.net forms authentication

I'm using Asp.net running on a shared hosting environment. I'm using forms authentication to authenticate users. Now I need to add support for the users to create pdfs and images and save them on the server. The problem is that I need to protect the pdf/image created so only the user that created the file can use it, so it is protected f...

Set focus to end of text in textbox after postback?

I've got a simple ASP.Net form with txtBox and btn. User click btn, which adds text to an ASP:TextBox in a postback (its adding a known "starter text". After the postback I'd like the focus to be set to the end of the text in the textbox. If I call Page.SetFocus(...) or txtBox.Focus() then the txtBox gets focus, but at the beginning of ...

ListView and DataPager implementation in FW 3.5 works but misbehaves when project migrated to FW 4.0

I have 2 listviews in an asp.net page. Both use a datapager with a dropdown (showing X of X pages, each listview can show just 5 records in a single list page). Based on selection in the first, I show some items in the second listview and I also have ability to add new items in the second one. When I add new items in the second listview...

get selectedValue of dropdownlist from code behind

On an aspx page I have a dropdownlist and a button. I select a value from the dropdownlist and click the button. In the button event handler I have the statment: DropDownList1.SelectedValue; This value is showing up as the first item in the list regardless of what item is actually selected. Same result with .SelectedItem.Value and ....

Set focus in TextBox after postback.

I have a simple page where I want to filter a ListBox based upon a value(s) in a textbox - both are in an UpdatePanel. This works correctly, however, after the postback the textbox had lost focus...so I set focus back in the page_load. Then I noticed that the cursor was now at the beginning of the text when I want it at the end so the us...

Is it possible to get an asp.net 'OnClicked' callback in javascript to call a function in a web control?

Title says it all, it does seem like it wouldn't be possible since callback functions seem to be page specific but in case it's possible I'd like to do that. ...

How to apply customized css to SSRS report

I am new to SSRS. I have created a report and was able to deploy it on the server. I am calling the report from ASP.NET application. How can I change the CSS of the report? I want to change the styles for individual data cells of the table deing displayed also. How is it possible? Thanks in advance. ...

Creating default templates on Repeater that are overridable by users

I have a webforms control, my:Repeater, that is an asp:Repeater. I want to make a default template, like: <my:Repeater> <HeaderTemplate> My Default Header </HeaderTemplate> <ItemTemplate> My data </ItemTemplate> <FooterTemplate> My Default Footer </FooterTemplate> </my:Repeater> I want this template to be in so...

Bind value of property to result of some method in ASP.NET

Hi, there! I need to bind an ASP.NET control something like so: <asp:label ID="lblName" Text=<%# GetName()) %> and in CodeBehind file I have this method: protected string GetName() { ... } Is this right, or how I can do something like this? ...

Many-to-Many Databinding in LINQ

I've looked all over and haven't been able to find a clear answer to a seemingly common question: How can I do two-way databinding over a many-to-many relationship in ASP.net? I have the following database structure: I am currently writing a page for editing or adding a User record. Databinding things such as name and password is simp...

JQUERY autocomplete and asp.NET

Hi, how can i use this script: http://www.pengoworks.com/workshop/jquery/autocomplete.htm with a web service? Thanks! ...

Scaling and Serving Images With .NET 3.5

Hi, I am working on a web application where images has to be scaled dynamically and served to the client as fast as possible (with low overhead). I need to create something that scales and compresses high-quality PNGs to medium quality JPEGs. Now, there are multiple ways of doing this and I am slightly confused which method provides th...

c# code to control swf file

how to control .swf file from c#. I was developed one asp page which contains flash file. Is there any possibility to play and pause that flash file? ...

What is the difference between these comments

What is the difference between these types of comments in ASP.NET's ASPX markup page? <%-- something here --%> and the html comment <!-- something here --> ...

ASP.NET App Exports to Excel (or not in this case)

Hi All, Exising .net 2 app migrated to .net 4 and moved to an IIS7 Windows 2008 R2 server. We used to be able to run some code on the web page to export some stuff to excel. Now, when we do... we get the following error: The machine-default permission settings do not grant Local Activation permission for the COM Server application wi...

How to get Client timeZoneOffset from server side code

How can I get getTimezoneOffset(); value from the client side in codebehind(aspx.cs file) on Page_load event? ...

Setting a server control property from the content page

Hi, I need to validate a textbox to ensure the submit date is older than Today. I wanted to use a CompareValidator to do that, but unfortunately the following code doesn't work: <asp:CompareValidator ID="cvtbDateExpiration" ControlToValidate="tbDateExpiration" Operator="GreaterThan" Type="Date" ValueToCompare="<%= DateTime.Today %>...

equivilent to c# SortCompare in asp.net

I found the following event that I want to use in my asp.net app. private void grid_SortCompare(object sender, DataGridViewSortCompareEventArgs e) { try { if (e.RowIndex1 == this.dataGridView1.Rows.Count -1) e.Handled = true; if (e.RowIndex2 == this.dataGridView1.Rows.Cou...