Results 1 to 6 of 6

Thread: adding C# user control in ASP.NET

  1. #1

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    adding C# user control in ASP.NET

    i have a simple question .. i made a User control in C# / Windows Control Library and i want to insert in a C# Web Application in a ASPX page but after coming on Toolbox it gets Disable and doesnt come on Page. but if i paste same control in a Windows Application it gets insert like a user control. In Web application it gets added in solution but doesnt come on page . is there ne special setting in User control to add it in Web Application.

    tell me how to do i want to add user controls in Web application.


    regds
    Chander
    Email:[email protected]

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Windows user controls and web controls are different. Creat a web control, then you can add it to your pages.

  3. #3

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225
    humm .. well i m able to create a WebUser control and its coming in a Web Form but in code I m not able to Show MessageBox method .. it says assembaly not found and when i try to Add its namespace i.e. System.Windows.Forms it gives Windows namespace not found .. it doesnt give even System.Window in using section ... Is there any other namespace for Messagebox in WebForms or any other dialogue Box to show information in Web Forms .. ???
    Chander
    Email:[email protected]

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You can't use anything in the System.Windows.Forms namespace. What exactly are you trying to do? Do you want to popup a messagebox? If so, you are going to have to do this with JavaScript.

    If you detail exactly what your trying to do with this control, we can probably help you a little better.

  5. #5

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225
    u r right .. i just want to popup some messagebox when user does some thing wrong .. u can say some validation check .. as control would b on server so i can understand at client stand it wont come and hv to use some client side scripting to use that but for tht , do i need to use Events in my control so that when ever i want to show ne message box i raise an event .. or there may b some other way to do it .. my requirement is simple i.e. to show a message box in aspx page when ever user does some thing wrong in my webuser control which is at server side ...

    suggest me some easiest way to do it ...
    Chander
    Email:[email protected]

  6. #6
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Create some Javascript code that will run on page load on the client side that will popup a messagebox. Maybe put it in a literalcontrol or something....? I am not exactly sure how to go about it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width