Monday, April 7, 2014

Q) table inside table html ?

A) <table border="1" width="100%">
<tr>
<td>ABC</td>
<td>ABC</td>
<td colspan="2">ABC</td>
<td>ABC</td>
</tr>

<tr>
<td rowspan="3">ITEM</td>
<td rowspan="3">ITEM</td>
<td>name</td>
<td>price</td>
<td rowspan="3">ITEM</td>
    </tr>
    <tr>
<td>name</td>
<td>price</td>
    </tr>
<tr>
<td>name</td>
<td>price</td>
    </tr>
    <tr>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
    <tr>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
</table>


CHECK THI FIDDEL:
http://jsfiddle.net/zWMUU/1/

Sunday, March 9, 2014

TryUpdateModelto Dosent Store values to database ?

Answer: After TryUpdateModel(model))
         
perform savechanges to the database here db is 
yourdatabaseaccessfile db = new yourdatabaseaccessfile ();
                db.SaveChanges();
this will save values to db.

Thursday, February 27, 2014

How to use Google Charts ?

Answer : Google charts is a simple way to use display charts in our web page just by passing  values through query string(i.e passing values through url ex: www.website.com/page?value1=1&value2=2) 


pie chart :http://chart.apis.google.com/chart?cht=p&chs=410x250&chdl=Walklists%7CPhone+Bank%7CDirect+Mail%7CEmail&chco=CB4B4B|EDC240|4DA74D|9440ED&chp=0.436326388889&chtt=Current+Activities&chts=666666,20&chl=20%|20% |50%|10%&chd=t:20,20,50,1
values highlighted in yellow are the values you have to provide 



 bar chart :
http://chart.apis.google.com/chart?cht=bvs&chs=410x250&chco=4DA74D&chxt=x,y
&chxl=0:|Walklist%201|Walklist%202&chbh=a&chtt=%%20Walklist%20Completion&chts=666666,
20&chd=t:50,66,0


to change the chart style and type there are few modification you have to do with the url :
they are :


For More info : https://developers.google.com/chart/image/docs/gallery/chart_gall

Thursday, February 20, 2014

javascript for On click open new window ? or popup window .

solution : window.open("url");
How to test website on different browsers and differnt version of os ?

Solutuion :  http://www.browserstack.com/
  How to get Temprary email ?

solution : http://getairmail.com/ssbbi/lUur
How to detect if browser is ie6 or ie7 r ie8 ?(ie=internet explorer)

Solution :
(function ($) {
                "use strict";

                // Detecting IE
                var oldIE;
                if ($('html').is('.ie6, .ie7, .ie8')) {
                    oldIE = true;
                }

                if (oldIE) {
                    alert("its old..");
                } else {
                    alert("you are good");
                }

            }(jQuery));



or 

just add this code on the top :

 <!doctype html>
    <!--[if IE 8]>
<script type="text/javascript">
    alert("ie8");
</script>
<![endif]-->
    <!--[if  gte IE 8]> <html > <script>alert("greater than ie 9 ");</script>  <![endif]-->
    <!--[if lt IE 9]> <html > <script>alert("low than ie 9 .Please upgrade");</script> <![endif]-->
    <!--[if !IE]> <html > <script>alert("Not IE");</script><!-->
    <html lang="en">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->

    <head>
/* here starts your code*/

Thursday, February 13, 2014

>>How to write Mutileple else if with databinder in asp.net ?
Ans) for a singel if else statement its prity straight forward
             
<%# (DataBinder.Eval(Container.DataItem, "ColomnName").ToString()=="abcd") ? "true": "false"%>


for multiple just use this :


<%#(DataBinder.Eval(Container.DataItem, "ModuleName").ToString()=="abcd") ? "yes its abcd" :
 ((DataBinder.Eval(Container.DataItem, "ModuleName").ToString()=="efgh")   ? "yes its efgh" : "no its not abcd or efgh"))%>

Tuesday, February 11, 2014

**) Validation in between html code in asp .net.
Ans) example:

 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-check"></i>
                                    <%
                                        if (Convert.ToInt32(Session["abcd"]) != 0)
                                        {
                                    %>
                                    <span class="abc" id="Span1">

                                        <%=Session["xyz"] %> 
                                 
                                    </span>
                                    <%
                                    }
                                    %>
   </a>
**) get session variable values in javascript .

Ans) var topnavig = '<%=Session["TopNavig"]%>'
**) how to replace html inside tags by id.
Ans.
document.getElementById("id").innerHTML = <p> html content you want to show </p>;
**) How to remove html  node in jquery .
>>>  $('#id').remove();
 do this in document.ready function  as it only works after once the document is ready.
**) on click goto other page in javascript .
>>> window.location = "/nextpagename"; if you want to be in your local network or standarad url
**) Get current url in javascript .
>> var path= window.location.pathname;
**) Set session variables in javascript .
>>
method 1;
 <% var val1 = "xyz";%>
     
 <%Session["abc"] = val1 ; %>;

method 2:

    sessionStorage.setItem("Team_id", window.teamid);