Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chad Rosenthal 272 posts 474 karma points
    May 20, 2010 @ 06:51
    Chad Rosenthal
    0

    Best way to create a new user control in VS 2008

    Just curious. Right now I have I'm creating a new user control. In this case, it's a contact us form similar to the form in the Starter Kit. I have the .ascx and all .cs code in a project. I compile the project. Copy the .dll from the project into my site's bin folder. I then copy the .ascx from the project to the /usercontrols folder. Then test. I then need to repeat this for every change I make.

    I know that there has to be a better way to do this. I've tried add the project to the site's project. I still would have to copy the .ascx over, but when I tried this one time and compiled the site, it broke everything and I had to basically rebuild the site.

    Thanks.

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    May 20, 2010 @ 07:43
    Sebastiaan Janssen
    1

    There is an easier way, check out my blog post that is about debugging but also shows my complete Visual Studio set-up.

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    May 20, 2010 @ 07:44
    Sebastiaan Janssen
    0

    By the way, about the site breaking: I think the trick is not to actually build the whole website (which is also mentioned in the blog post).

  • Mikael Mørup 297 posts 326 karma points
    May 20, 2010 @ 10:34
    Mikael Mørup
    1

    In your VS project you can ad a postbuild event to copy the files automatically after every build. This saves a lot of copy paste time.

    Just make sure to also copy the PDB file to the bin folder if you want to do any debugging.

  • Md Johirul Islam 37 posts 57 karma points
    Oct 13, 2011 @ 13:44
    Md Johirul Islam
    0

    Hi I am new in umbraco CMS .net controler. I am just wondering any one cal help me to create a customize Contact form by Web User control. I follow thw whole tutorial. But the problem is when i add valodation contron on my form. Then i found this erroe message...

     

    The ControlToValidate property of 'RequiredFieldValidator1' cannot be blank. and more ......

     

     

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ContactUsForm.ascx.cs" Inherits="ContactUsForm.ContactUsForm" %>

     

     <form action="" method="post" name="contactus">


    <table width="672" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td width="292"><input type="text" name="fname" id="fname" value="First Name"/><asp:RequiredFieldValidator 

                        ID="RequiredFieldValidator1" runat="server" 

                        ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

                  </td>

                <td width="380" rowspan="6" valign="top"><table width="380" border="0" cellspacing="0" cellpadding="0" id="contact2">

                    <tr>

                      <td colspan="2"><textarea name="txtcomments" id="txtcomments" cols="45" rows="5">Enter text...</textarea></td>

                    </tr>

                    <tr>

                      <td width="187"><input name="Captcha" type="text" class="captcha" id="sml-input" value="78  BHG" /></td>

                      <td width="193"><span id="accessiblity">Ut et metus dapibus dolrutrum vestibulum molestie id ligula.</span></td>

                    </tr>

                    <tr>

                      <td colspan="2"><input name="sml-input" type="text" id="sml-input" value="Enter Code" /></td>

                    </tr>

                    <tr>

                      <td colspan="2"><a class="button" type="submit" href="#">Send Enquiry</a></td>

                    </tr>

                  </table></td>

              </tr>

              <tr>

                <td><input name="fname" type="text" id="lname" value="Last Name" /></td>

              </tr>

              <tr>

                <td><input name="company" type="text" id="company" value="Company Name" /></td>

              </tr>

              <tr>

                <td><input name="emailaddress" type="text" id="emailaddress" value="Email address" /></td>

              </tr>

              <tr>

                <td><select name="country" id="country">

                    <option>Please select your country</option>

                  </select></td>

              </tr>

              <tr>

                <td><label>

                    <input type="checkbox" name="chkmail" id="chkmail" />

                    I would like to receive relevant insight, news and reports from ICLP</label></td>

              </tr>

            </table>

            </form>


    Please give me an idea or anything else. Thank you.......

     

     

Please Sign in or register to post replies

Write your reply to:

Draft