Friday, 5 July 2013

Retrieve data from visible false BoundField of Gridview

get value of visible false boundfield in gridview Asp.net

<style type="text/css">
     .hidden
     {
         display:none;
     }
</style>

<asp:BoundField DataField="ReportId" HeaderText="RId"  >
    <ItemStyle CssClass="hidden"/>
</asp:BoundField>

Gridview row hover alert rowindex

on hover Gridview row, show row index as alert message

write onmouseover on rowdatabound

protected void mygridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex != -1)
{
e.Row.Attributes["onmouseover"] = "showContents('" + (e.Row.RowIndex + 1) + "')";
}

}

 <script type="text/javascript">
        function showContents(rowIndex) {

            var gv = <%= mygridview.ClientID %>;
            var rowElement = gv.rows[rowIndex];
            var title = rowElement.cells[0].innerHTML;
            alert(rowIndex + ',' + title);

}

Wednesday, 26 June 2013

select from table distinct column

SELECT * FROM TABLE WITH DISTINCT COLUMN
---------------------------------------------------------------

SELECT * FROM [TABLE NAME]
WHERE [ID] IN (
  SELECT MIN([ID]) FROM [TABLE NAME] GROUP BY [DISTINCT COLUMN NAME])

Example:

       SELECT FROM [SKILLS] WHERE [ID] IN
       (
      SELECT MIN([ID]) FROM [SKILLS] GROUP BY [SKILL NAME]
       )

Friday, 21 June 2013

string split using jquery / java script

var a = "one,two,three".split(",") // Delimiter is a string
for (var i = 0; i < a.length; i++)
{
alert(a[i])
}

var b = "1+2=3".split(/[+=]/) // Delimiter is a regular expression
for (var i = 0; i < b.length; i++)
{
alert(b[i])
}

Friday, 14 June 2013

500 Internal Server Error” when adding HttpModule in my Web.config

use the following new module syntax made for IIS7 (godaddy is using IIS7 for windows hosting)
<configuration>
   <system.webServer>
      <modules>
         <add name="Header" type="Contoso.ShoppingCart.Header"/>
      </modules>
   </system.webServer>
</configuration>
here details about module tag  

Tuesday, 12 March 2013

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

Set Identity : LocalSystem
enter image description here

You can change the ApplicationPoolIdentity from IIS7 -> Application Pools -> Advanced Settings.

AdvancedSettings

Convert SVG to PNG using svg.dll

      <div id="divsvg">        <svg width="350" height="300"><defs></defs> ............