Wednesday, April 6, 2011

How to support SSL for JQuery CDN

Google and Microsoft both support https.
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
</script>
 
<script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> 

How to make full screen div by css

<style type="text/css">
  fullscreen{
    position:fixed;
    top:0%;
    left:0;    width:100%;
    height:100%;
  }
</style>

What is Viewbag in ASP.NET MVC

The ViewBag object is a wrapper on ViewData object. So you can access ViewData without data type converting in html.

Code example:

In controller

        public ActionResult Index()

        {

            ViewBag.TestName = "teststring";

            return View();

        }



In cshtml:

<h2>

   @ViewBag.TestName

   @ViewData["TestName"]

</h2>



   @ViewData["TestName"] is equal to  @ViewBag.TestName in here

Reference:



You can use strong type data in html view by Viewbag.

It is a new feature in ASP.NET MVC 3 to pass data from Controllers to Views as same as ViewData.
But Viewbag is the dynamic type.
ViewData
<p>
    My name is
    <b><%: ViewData["name"] %></b>,
    <b><%: ViewData["age"] %></b> years old.
    <br />  
    I like the following colors:
</p>
ViewBag
<p>
    My name is
    <b><%: ViewBag.Name %></b>,
    <b><%: ViewBag.Age %></b> years old.
    <br />  
    I like the following colors:
</p>

ActionResults explained in ASP.NET MVC

Action results are an important part of the ASP.NET MVC controller system, and definitely worth taking a good look at. Understanding how they work gives you many more choices in MVC and that will certainly help make your code better.


http://rachelappel.com/asp.net-mvc-actionresults-explained