Setting default button by using panel

Posted by Venkat | Labels: ,

Here We have to discuss about how to set the default button in Masterpage
for ex: in Master i have Search_textbox and Search_button when the user enter some text in the Textbox and pres Enter so the Search_button should trigger..

Html Code

<asp:Panel ID="SearchStyle_Panel" runat="server" width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                              <td width="188" align="right" valign="middle" class="white_text">
                                   SEARCH
                              </td>
                               <td width="235" align="right" valign="middle">
                                   <asp:TextBox ID="search_textbox" runat="server" value="ENTER KEYWORD" onfocus="if (this.value == 'ENTER KEYWORD') {this.value = '';}"
                                      onblur="if (this.value == '') {this.value = 'ENTER KEYWORD';}" CssClass="textbox"></asp:TextBox>
                               </td>
                             <td width="5" align="right" valign="middle">
                          </td>
                           <td width="40" align="right" valign="bottom">
                                 <asp:Button ID="search_button" runat="server" Text="GO" CssClass="go_btn"/>
                              </td>
                           </tr>
                      </table>
                     </asp:Panel>

since the button is nested inside of a control that implememts INamingContainer, its UniqueId will not match its server ID

for that reason, you should set the DefaultButton property in code.

myPanel.DefaultButton = myButton.UniqueId

then on page_load

SearchStyle_Panel.DefaultButton = search_button.UniqueID

Publish a Web project

Posted by Venkat | Labels:

Here we are going to see how to publish a web site project . While doing so , you can convert to assemblies, also on you published website folder it contains only .aspx file you cant able to view the code behind file (.aspx.vb , .ascx.vb , .vb , .cs files)

This is for the Security purpose no one able to modify you code..

these are the steps :
  1. On the Build menu, click Publish Web Site.
  2. In the Publish Web Site dialog box, click the ellipsis button (…) to browse to the location to which you want to publish the Web site.
    You can write the Web site output to a local or shared folder, to an FTP site, or to a Web site that you access with a URL. You must have Create and Write permissions in the target location.
  3. To be able to change the layout (but not the code) of .aspx files after publishing the Web site, select the Allow this precompiled site to be updateable check box.
  4. To name strongly named assemblies using a key file or a key container, select the Enable strong naming on precompiled assemblies check box, and then click OK.
    Publishing status is displayed in the taskbar. Depending on the connection speed, the size of the site and the types of content files, publishing time can vary. When publishing is completed, the status of Publish succeeded is displayed.
  5. Make any configuration changes that are necessary for your site. For more information, see How to: Configure Published Web Sites. You might also want to encrypt specific configuration settings. For more information, see Encrypting Configuration Information Using Protected Configuration.
Ref : 
http://msdn.microsoft.com/en-us/library/20yh9f1b(VS.80).aspx
http://msdn.microsoft.com/en-us/library/1y1404zt(VS.80).aspx
http://msdn.microsoft.com/en-us/library/aa983453(VS.80).aspx

PayOffers.in