How to judge whether it is under the design mode?

ASP.NET

    Next

  • 1. Placing Controls on a WebForm
    Hello All, Simple Question here. I Hope. I am trying to place a control on another control. Ex: Taking a Flow Layout Panel and putting say a text box on it. How would you do that. I am also wondering how do you turn this infernal locking of controls off when developing a page on the .aspx form. This is really cumberson at times. Any help would be appreciated.
  • 2. RegisterRequiresPostBack and child custom controls
    I have a composite custom control that creates other custom composite controls within CreateChildControls(). 2 questions: 1) Must you explicitly call Page.RegisterRequiresPostBack for every control that is interested in postbacks? I assumed from the documentation that the ASP.NET page framework would call LoadPostData on every IPostBackDataHandler that was a part of the control tree. This was not happening for my custom controls until I registered them with Page.RegisterRequiresPostBack within the control's OnInit(). Is this expected behavior? 2) Registering with Page.RegisterRequiresPostBack() caused my top-level custom control's LoadPostData to be fired, but not those of the child custom controls. Within my top-level control, do I have the responsibility to propogate the LoadPostData() to child controls? For example: public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection) { foreach(Control c in Controls) { c.LoadPostData(postDataKey, postCollection); } } Thanks in advance. CH
  • 3. DropDownList inside Repeater control
    Is there any (preferably simple) way to populate a dropdownlist control inside a Repeater control on a webform? I'm able to do buttons but need assist on the dropdownlist box part!! simple code snippet would be great!! Still too new at this I guess... Many thanks in advance! wardeaux
  • 4. passing empty fields to SQL
    I have created an online survey. I get this error, "Expects parameter fieldname, which was not supplied." when the submit button is clicked. This field is empty. In other words, I need to make this and other fields non required. How can I do this? I am using VS.NET. Thanks Jim

How to judge whether it is under the design mode?

Postby TGFzZXIgTHU » Wed, 02 Jun 2004 21:01:03 GMT

I want to judge whether it is currently under the design mode in the code when I was developing a web control. The question is how to achieve it? Is there any property that indicates the current mode the code was runnig under?

RE: How to judge whether it is under the design mode?

Postby jamesche » Thu, 03 Jun 2004 00:09:08 GMT

Hi, 

One way to do this is to check HttpContext.Current.  If it's null, you are 
in design mode.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
 XXXX@XXXXX.COM 

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
microsoft.public.dotnet.framework.aspnet.webcontrols:21065
when I was developing a web control. The question is how to achieve it? Is 
there any property that indicates the current mode the code was runnig 
under?


RE: How to judge whether it is under the design mode?

Postby TGFzZXIgTHU » Thu, 03 Jun 2004 10:56:03 GMT

A further question: How to get the file path of the current editing aspx page
    


    
     Hi,
    
     One way to do this is to check HttpContext.Current.  If it's null, you are
     in design mode
    
     Jim Cheshire, MCSE, MCSD [MSFT
     ASP.NE
     Developer Suppor
      XXXX@XXXXX.COM 
    
     This post is provided "AS-IS" with no warranties and confers no rights
    
     -------------------
     >Thread-Topic: How to judge whether it is under the design mode
     >thread-index: AcRH0ByXWCzwZIgNTv+AOISpBL1/pw=
     >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrol
     >From: "=?Utf-8?B?TGFzZXIgTHU=?=" < XXXX@XXXXX.COM >>Subject: How to judge whether it is under the design mode
     >Date: Tue, 1 Jun 2004 05:01:03 -070
     >Lines: 
     >Message-ID: < XXXX@XXXXX.COM >>MIME-Version: 1.
     >Content-Type: text/plain
     >	charset="Utf-8
     >Content-Transfer-Encoding: 7bi
     >X-Newsreader: Microsoft CDO for Windows 200
     >Content-Class: urn:content-classes:messag
     >Importance: norma
     >Priority: norma
     >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.
     >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrol
     >Path: cpmsftngxa10.phx.gb
     >Xref: cpmsftngxa10.phx.gbl
     microsoft.public.dotnet.framework.aspnet.webcontrols:2106
     >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.18
     >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrol
     >>I want to judge whether it is currently under the design mode in the code
     when I was developing a web control. The question is how to achieve it? Is
     there any property that indicates the current mode the code was runnig
     under
     >

RE: How to judge whether it is under the design mode?

Postby TGFzZXIgTHU » Thu, 03 Jun 2004 11:21:05 GMT

I'm now developing a web control. However, some information necessary to render the control is unavailable at design time. So I have to get accessed to the design time object model of the IDE, in order to find a alternative information. Then how to access the design time object model?

RE: How to judge whether it is under the design mode?

Postby TGFzZXIgTHU » Thu, 03 Jun 2004 11:56:02 GMT

For example, if I want to get the information of the currently editting aspx file, then how to do it
    


    
     I'm now developing a web control. However, some information necessary to render the control is unavailable at design time. So I have to get accessed to the design time object model of the IDE, in order to find a alternative information. Then how to access the design time object model?

RE: How to judge whether it is under the design mode?

Postby jamesche » Sun, 06 Jun 2004 01:05:56 GMT

Laser, 

What information specifically are you looking for?

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
 XXXX@XXXXX.COM 

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
< XXXX@XXXXX.COM >
microsoft.public.dotnet.framework.aspnet.webcontrols:21086
aspx file, then how to do it?
     


     
     I'm now developing a web control. However, some information necessary 
to render the control is unavailable at design time. So I have to get 
accessed to the design time object model of the IDE, in order to find a 
alternative information. Then how to access the design time object model?


RE: How to judge whether it is under the design mode?

Postby TGFzZXIgTHU » Mon, 07 Jun 2004 18:06:02 GMT

For example, I want to get the file path of the currently editing aspx page in code. Is that possible?

RE: How to judge whether it is under the design mode?

Postby jamesche » Tue, 08 Jun 2004 23:53:37 GMT

Hi, 

Yes, it is possible via extensibility.  DTE.ActiveDocument.FullName will 
return the path to the document currently being edited.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
 XXXX@XXXXX.COM 

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM >
microsoft.public.dotnet.framework.aspnet.webcontrols:21193
page in code. Is that possible?


RE: How to judge whether it is under the design mode?

Postby jamesche » Thu, 10 Jun 2004 07:42:51 GMT

Good deal.  Thanks for updating.  Glad to help.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
 XXXX@XXXXX.COM 

This post is provided "AS-IS" with no warranties and confers no rights.


--------------------
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM > 
< XXXX@XXXXX.COM >
microsoft.public.dotnet.framework.aspnet.webcontrols:21209
Hi, Jim! Thank you very much!! It really works!


     
     Hi, 
     
     Yes, it is possible via extensibility.  DTE.ActiveDocument.FullName 
will 
     return the path to the document currently being edited.
     
     Jim Cheshire, MCSE, MCSD [MSFT]
     ASP.NET
     Developer Support
      XXXX@XXXXX.COM 
     
     This post is provided "AS-IS" with no warranties and confers no rights.
     
     --------------------
     >Thread-Topic: How to judge whether it is under the design mode?
     >thread-index: AcRLpX3M2N4CeykVQk6vSMjOWxuWXA==
     >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
     >From: "=?Utf-8?B?TGFzZXIgTHU=?=" 
< XXXX@XXXXX.COM >>References:  
< XXXX@XXXXX.COM ><9857E26A-6E51-4529-8F7A
 XXXX@XXXXX.COM ><3DFFF806-3F6E-4FC4-90D9-C54457BC9AF4@microsoft.
com>< XXXX@XXXXX.COM >>Subject: RE: How to judge 
whether it is under the design mode?
     >Date: Sun, 6 Jun 2004 02:06:02 -0700
     >Lines: 1
     >Message-ID: 
< XXXX@XXXXX.COM >>MIME-Version: 1.0
     >Content-Type: text/plain;
     >	charset="Utf-8"
     >Content-Transfer-Encoding: 7bit
     >X-Newsreader: Microsoft CDO for Windows 2000
     >Content-Class: urn:content-classes:message
     >Importance: normal
     >Priority: normal
     >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
     >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
     >Path: cpmsftngxa10.phx.gbl
     >Xref: cpmsftngxa10.phx.gbl 
     microsoft.public.dotnet.framework.aspnet.webcontrols:21193
     >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
     >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
     >>For example, I want to get the file path of the currently editing 
aspx 
     page in code. Is that possible?
     >


Similar Threads:

1.Forms ok in design mode, cropped in run mode, only on my monitor

Hello to all, and happy new year!

I have this application that someone wrote that I'm
sort of checking out. The forms look fine in design
mode, but when I run the application, it crops off
the bottom of almost every form. I haven't figured
out yet if there's a pattern to it. I compared two
forms -- one that looks okay and one that gets cropped,
and aside from the size and the accept button and
the cancel button, their properties are identical.
I don't see anything in the code that is modifying
the size of the form, either.

The forms are all displayed as dialogs, if that matters.

Has anybody seen something like this before, or
do you have any ideas how I can figure out how to
fix it?

I talked to the original author of the application,
and it looks fine on his screen and on other people's
screens who have looked at the application.

I'd appreciate any advice you can offer me.
BTW, I'm using VB2005.

Thanks in advance,
Robin S. 


2.Different control theme in design mode and run mode

I have a problem with my C# program. In design mode in Visual Studio (2005) 
all the controls, like buttons, menus etc. show up as the modern XP theme. 
However, when I compile and run the program, they show up as the old 
Win95/Win2k theme. I'll provide screenshots if needed. 


3.Design Mode - My Constructor keeps running in design!

"Nick Bunton" < XXXX@XXXXX.COM > wrote in message
news:0a9201c34c75$8c03a6c0$ XXXX@XXXXX.COM ...
> On a few UserControls I have built I get errors in design
> mode when I try and view the design of the control as
> code in the constructor fires, they must be some way to
> stop this, but HOW???
>

The constructor is *supposed* to fire in design mode to let you initalize
your component. Inside the constructor, check to see if you are in design
mode and avoid anything that will cause errors:

Sub New( )
    If me.DesignMode Then

    Else

    End If
End Sub

HTH,
Jeremy

4.Get Whether System is In Insert Mode

    I am looking for a native .NET method to determine if the system is in 
InsertMode or OverwRite Mode 


5.Determining whether running in debug/release mode

How do I determine whether Im running in debug or release mode from code 
please.
thanks
Claire 


6. I am Using Dreamweaver to design a website of ASP.net

7. How to judge whether Microsoft Text Driver Exist programmatically?

8. How to judge whether content type is truly "text/html"?



Return to ASP.NET

 

Who is online

Users browsing this forum: No registered users and 71 guest