Tuesday, October 4, 2011

Monday, September 19, 2011

Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc

This error comes when you are trying to access SQL 2005 stuff from Visual Studio 2008. Download the following stuff

Microsoft SQL Server System CLR Types
Microsoft SQL Server 2008 Management Objects
Microsoft SQL Server 2008 Native Client

Monday, September 12, 2011

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

This error came because, in my master page there was a java script function like below

document.getElementById("<%=lblShoppingCart.ClientID %>").style.color = "#6CA2DE"

I used <%# instead of using <%=. It's work fine.

Here some valuable links related to this topic.

http://leedumond.com/blog/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks/

http://www.west-wind.com/weblog/posts/2006/May/27/The-Controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-ie-

Monday, August 15, 2011

Pass TextBox ID to javascript function


TextBox2.Attributes.Add("onkeyup", "Fill('" + TextBox1.ClientID.ToString() + "','" + TextBox2.ClientID.ToString() + "','" + TextBox3.ClientID.ToString() + "')")
 

<script type="text/javascript">
    function Fill(x, y, z) 
    {
            val1 = parseFloat(document.getElementById(x).value);
            val2 = parseFloat(document.getElementById(y).value);   
//code here         
    }
    </script>
 

Thursday, August 4, 2011

Light Box withing GridView Template Feild.

Hi,
In my web application there was a function to send Messages. I used jquery Light Box to pop up the message form. But when i hit GridView button for each row, it display only firstly created light box every time. Take a lookat code so u can understand.

<ItemTemplate>
<asp:Label ID="mn" runat="server" Text='<%#Eval("MobileToNum") %>' CssClass="dn"></asp:Label>
<a href="#" runat="server" id="cli" data-reveal-id="m" class="phone-number-click my-anc"><img src="../images/SMS.jpg" /></a>

<asp:Label ID="smsresultlbl" runat="server" Font-Size="XX-Small" Font-Bold="true"></asp:Label>
   <div id="m" class="reveal-modal mydiv">
   <table class="noborder">
<tr>
<td>Mobile No:</td><td><asp:TextBox ID="mobileNoTxt" runat="server" CssClass="textarea-medium"></asp:TextBox><%-- <asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter Mobile Number" ControlToValidate="mobileNoTxt" ValidationGroup="sms" Display="Dynamic"></asp:RequiredFieldValidator>--%></td>
</tr>
<tr><td></td><td><asp:Button ID="confirmbtn" runat="server" onclick="confirmbtn_Click" Text="Send"></asp:Button></td></tr>
</table>
   <a class="close-reveal-modal">×</a>
  </div>  
                </ItemTemplate>
 
The reason was data-reveal-id and pop up div id not in same name. I used javascript code for match these.

<script type="text/javascript">

     $(".phone-number-click").click(function() {
         //console.log($("span", $(this).parent()).html());
         $("#" + $(this).attr("mobnum")).val($("span", $(this).parent()).html());
     });

     $(".my-anc").each(function(e) {
         var id = "id-" + e;
         $(this).attr("data-reveal-id", id);
         $(".mydiv:eq(" + e + ")").attr("id", id);
     });

   </script>
 

I Built a New Kind of Number Puzzle Game (And You Can Play It Free)

 For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...