.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

server control state

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net

Hi there,

how can I figure out from within a server control wheather it is being used in design mode or in runtime ?

View Complete Post

More Related Resource Links

Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Sorting Data in a GridView Web Server Control

The GridView control provides built-in sorting functionality without requiring any coding. You can further customize the sort functionality of the GridView control by using custom SortExpression property values for columns as well as by using the Sorting and Sorted events

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

SQL Server Session state problem.


Hi to all,

I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.

1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?

Actualy Im working on it but Im having problems when connecting to the sql database.

2.  Is that a problem in the webhost?

3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.

video tutorial link for composite and rendered custom server control


hii all

i am new to technology so go easy on this post

according to what i read from web there are 3 type of custom server controls

1 superclass

2 composite

3 rendered

i found video tutorial for superclass custom server control but couldnt find video tutials for other 2.

please forward me link for composite and rendered custom server controls video tutorial  

require Video tutorial for Composite server control and rendered server control


hi guys

i am new to forum and technology so please go easy

according to what i read from web there 3 types of custom server controls

1. composite



i found video tutorial to create and use superclass custom control in your project (extending dropdown control functionality)

i am trying to search video tutorial for other 2 types .please help me.

image inside custom server control



I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?

Team System: Team Foundation Server Version Control


In this new column, Brian Randell begins his long look at how to extend and enhance Visual Studio Team System.

Brian A. Randell

MSDN Magazine January 2007

AssemblyInfo file not present in ASP.NET Server Control Project



I have created my first Custom asp.net server control.But i think such projects probably contains AssemblyInfo file.But i am missing that. When i created project that file was not added.

I am working on VS 2008 Team System Edition,with VB.NET language.How to get that file ? 

SQL Server 2005 x64: Intermittent "Error: 18456, Severity: 14, State: 10."

Hi, We are experiencing intermittent authentication errors "Error: 18456, Severity: 14, State: 10" on a customer's production server. This is a new server that has just been rolled out in the past several months. Rebooting the server appears to make the problem go away. We are using SQL authentication from a separate server that is running IIS. The application always uses the same username and password to connect. Server info: select @@versionMicrosoft SQL Server 2005 - 9.00.2047.00 (X64) Apr 14 2006 01:11:53 Copyright (c) 1988-2005 Microsoft CorporationStandard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 1) select @@versionSP1 Sample error from SQL Server errorlog: Date  7/7/2006 10:53:24 AMLog  SQL Server (Archive #2 - 7/7/2006 12:20:00 PM)Source  LogonMessageError: 18456, Severity: 14, State: 10. MSDN (http://msdn2.microsoft.com/en-us/library/ms366351.aspx) lists various states for this error message but 10 is not included, and it says "Other error states exist and signify an unexpected internal processing error." Note: This was not a case of a transient error that occurs only when SQL Server is starting up - these errors occurred at a variety of times, two months after the server was last rebooted / SQL Server last restarted. Thanks for any help you can provide. Regards,-Frank.

Getting an error using FileUpload Control on a server.

Hello FriendsI m getting a problem while executing the following code for my website.This code works perfactly on localhost but when I use d same code on my webpage on the server it does nothing...even it doesnt return any error msg.Plz help me...protected void BtnUpload_Click(object sender, EventArgs e) {        int intFileSizeLimit = 1000;               string strFileNameWithPath = FileUpload1.PostedFile.FileName;               string strExtensionName = System.IO.Path.GetExtension(strFileNameWithPath);              string strFileName = System.IO.Path.GetFileName(strFileNameWithPath);           int intFileSize = FileUpload1.PostedFile.ContentLength / 1024;                              strExtensionName = strExtensionName.ToLower();        if (strExtensionName.Equals(".doc") || strExtensionName.Equals(".txt") || strExtensionName.Equals(".docx"))        {      

Accessing Session State in a User Control

We have a web site that implements a custom SiteMapProvider using a User Control added in the master page. I need to be able to limit the sitemap nodes added depending on the logged in user, that is, certain users should not see certain sitemap nodes. Currently, the login processing code determines if users are in the certain category or role and then sets a value in session state, for example, Session["UserInRoleXXX"] = "Yes"; I tried changing the code in the user control to check the session state, but I got the following error: NullReferenceException ... Object reference not set to an instance of an object." Can session state be accessed in a user control? If so, how? If not, any suggested solutions? Thanks in advance for any help.

Msg 8624, Level 16, State 13 - Internal SQL Server error.

Hi, I have a weird T-SQL 80 query full of nested subqueries full of aggregations tha thas been embedded in a view. if I do select * from the view I get: Server: Msg 8624, Level 16, State 13 Internal SQL Error.  If I run the same block of code from the query analyzer it runs fine. Also if I wrap exactly the same code in a SP it runs fine. I'm running this on a SQL Server 2000 Standard Edition SP4 8.00.2282. + I turned on the following Trace Flags: 3614, 9052, 9054, 9056, 9057, 9185, 9256. If I restore the same DB on a SQL Server 2005 and do the same select * it runs fine. So I'm getting the Error 8624 only on my SQL 2000 Standard edition  SP4 8.00.2282. Another thing I dont understand is also: why I can compile the view but if I try to visualize even the query plan I get the same error?!? Any suggestion will be appreciated. Thank you. Regards, Marco    

Server: MSg 17, Level 16, State 1 [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not e

Hi All, When we try to connect to a sql server 2000 using SQL server authentication, we are facing the below mentioned error msg. "Server: MSg 17, Level 16, State 1 [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied" But, once we connect to server using Windows NT login from the client machine, i.e., execute the below command in the run prompt and provide the credentials for windows login, we are able to connect to the server using sql server authentication(user name: sa) \\server_ipaddress\c$ When we went though some of the msdn links, found that windows firewall was the major cause. But, in the server 1. Windows Firewall is turned off 2. TCP/IP and NamedPipes are enabled 3. Default Port Number is 1433 Any user, who wants to connect to the SQL Server using SSMS, first have to perform a Windows NT login and then connect using SQL authentication.  Due to the above error, the DTS packages which are executing in a different server are getting failed. NOTE: Even after connecting to the server using Remote Desktop connection in a local machine, SQL authentication fails. Its manadatory to run the command \\server_ipaddress\c$ in each of the local machine. Any suggestion to resolve the above error is very much appreciated.   Thanks in advance, Raksha Hegde       

Treeview web server control client side evnts

HiI'm using Treeview control with asp.net 2.0. I would like to know how to get the client side events working. I don't want a post back for every little thing i do with the Treeview. Particularly i want to catch the node click event on the client side using java script, i want to enable/disable buttons based on the selected node. Is this possible? i tried some examples available on net but doesn't seem to be working. Please help me.. can someody give a working example....John 

custom server control with custom child collection,get the collection?

Hi!I want to create a custom server control, that then will have a custom child collection.The thing is that I also want to be able to modify the custom childs from the custom server control classFor example I have a row of cards, and the class is called CardRow, a CardRow is simply a class full of the class card in this case, se the class "Card" down below:using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections.Generic; namespace MemoryLib { [ToolboxData("<{0}:CardRow runat=server></{0}:CardRow>")] public class CardRow : WebControl { public List<Card> _Card; [PersistenceMode(PersistenceMode.InnerProperty)] public List<Card> Card { get { return _Card; } set { _Card = value; } } public CardRow() { } protected override void CreateChildControls() { } protected override void Render(HtmlTextWriter writer) { } } } using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace MemoryLib
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend