asp.net

ASP.net access a master page variable through content page

I have a master page: <%@ Master Language="C#" AutoEventWireup="true" Codefile="AdminMaster.master.cs" Inherits="AlphaPackSite.MasterPages.AdminMaster" %> Then I have a public variable: public partial class AdminMaster : System.Web.UI.MasterPage { protected bool blnShowDialogue = false; In my content page I would like to set th...

ASP.NET MVC2 User Profiles

Hi. What is the easiest way to create users with associated profiles in MVC2? Is there any library already having such functionality? Thanks in advance. ...

Is it possible to return a string using event : dropdownlist_Onselectedindexchange(object sender,eventargs e)?

Is it possible to return a string using event : dropdownlist_Onselectedindexchange(object sender,eventargs e)? ...

OnChange event on FreeTextBox

Hi All, I am using the FreeTextBox ASP.Net HTML editor control. I am trying to make a javascript call when the text value changes. The control has a property called "ClientSideTextChanged" which is supposed to get fired on text changed, but instead fires on load of the control. Can any of you tell where i am going wrong. ...

server side validation ?

hi all i want to know that if apply server side validation on text box then when validation event fire (i means in wich state of page cycle this validation has been done in server side) ...

Best practices to design component based asp.net application

Hi all , I am starting to design my own CMS , and i want it to be modular to add more functionality later by me or by any other developer I put my eyes on joomla CMS (very popular ,robust and extensible) I want to make a CMS with asp.net to be just skeleton and all functions are done through components Functions like :- User manage...

How to read system.webserver configuration section?

Hi everybody. Is there any 'nice' way to read configuration section group of IIS7 by using WebConfigurationManager o anything? I tried to read the authorization section but WebConfigurationManager.GetSection() returns an 'IgnoredSection' instance. This is what my code looks like... authSection = WebConfigurationManager.GetSection("sy...

Newline in SQL Server

Can anybody tell me how to save newline in database and also retrieve it in a same manner using asp.net. ...

ASP.NET membership can I get a directory to return 403?

I have an existing app that I've been doing some authentication work on (fixing some long standing issues) and I'm happy enough with the login redirection under normal circumstances. For IIS7 I'm implementing an authorization HttpModule that I'm running on the whole IIS7 pipeline. This works great but I'd like to get some subdirectories...

Optimize code: Linq and foreach loop 15k records

this is my code void fixInstellingenTabel(object source, ElapsedEventArgs e) { NASDataContext _db = new NASDataContext(); List<Instellingen> newOnes = new List<Instellingen>(); List<InstellingGegeven> li = _db.InstellingGegevens.ToList(); foreach (InstellingGegeven i in li) { if (_db.Instellingens.Count(q => q....

Gridview retrieval

I am entering int type values in datebase say for example the user_type and want it to retrieve in a column of gridview in its corresponding meaning in varchar type... Can anybody help me out of this!!! ...

C# regex to get video id from youtube and vimeo by url

I'm busy trying to create two regular expressions to filter the id from youtube and vimeo video's. I've already got the following expressions; YouTube: (youtube\.com/)(.*)v=([a-zA-Z0-9-_]+) Vimeo: vimeo\.com/([0-9]+)$ As i explained below there are 2 types of urls matched by the regular expressions i already created. Several other ty...

Sharing MasterPages and styles/other media between ASP.NET MVC sites, using MVCContrib PortableAreas

Any way to have a Portable Area containing resources common to several MVC applications (when added as a reference to the project depending on it)? Wanting to have a 'Core' set of pages, styles, masterpages, javascript etc, but not found an easy way to do this. Tried a few things to reference the master page, but not had any luck. The f...

client side validation and server side validation in java script and asp.net respectively ?

hi all i want to know that can we validate a control which is out side a form element in asp.net(server side validation)and outside a form element in html(client side validation) let's take a closer look <html> <body> <input type="text" name="first name"/> </body> </html> can we apply clien side validation on above text box by jav...

Html.EditorFor in an MVCContrib PortableArea

I am trying to use Html.EditorFor in a Portable Area (i.e. so create and edit use the same form), but it doesn't seem to working (fine when it is not in the Portable Area though). In the page, I just have: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MySite.Models.DocumentType>" %>...

ASP.NET application throwing "unable to find assembly" error for NHibernate

So let me start by saying that the weird thing about this error is that the application is running, and the error bubbles to the event log, but it's intermittent. Sometimes it's 2 hours between it happening, sometimes a few minutes, sometimes half an hour. Does not appear to be tied directly to requests (and requests don't seem to be f...

How do I receive input to a hidden textbox and submit a form?

Hello all, I have an ASP.NET application designed for a Windows CE device that needs to take in information from a scanned barcode. The device sends the scanned data as string input with a crlf to whatever field has focus. I set up my page with a textbox that takes the input and posts back to look up the item. Now, I'd like that box to...

Divide data into several datasets/listview which are shown in jquery tabs

Hi, I'm extracting data from a webserivce. This is my select statement to retrieve the data: string cmdstr = "select title, titlefr, racpnr, racpmodeltype from onl_wgn where show = 1 order by onl_kl, racpnr"; I got 4 groups of onl_kl. Now I want to show each group in a tab of the jquery tabcontainer. I can pass the data in a datas...

How do I return unnamed JSON string array from asp.net mvc2 json result?

I have the following code: var json = MyObject .Select(p => new { id = p.MyObjectId, name = p.MyObjectName }); return Json(new { json }, JsonRequestBehavior.AllowGet); This returns a JSON object as follows: { json: [ { id: 1, name: "Bob" }, { id: 2, name: "Fred" }, { id: 3, name: "James" } ] } However, ...

What algorithm does Readability use for extracting text from URLs?

For a while, I've been trying to find a way of intelligently extracting the "relevant" text from a URL by eliminating the text related to ads and all the other clutter.After several months of researching, I gave it up as a problem that cannot be accurately determined. (I've tried different ways but none were reliable) A week back, I stu...