Tuesday, November 30, 2021

Response.redirect like in javascript insimple html

 // Simulate a mouse click:

window.location.href = "http://www.w3schools.com";

// Simulate an HTTP redirect:
window.location.replace("http://www.w3schools.com");


Jquery bootstrap collapse toggle

 https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_collapse&stacked=h

difference between Varchar and nvarchar and char

 Varchar:-

  1. It is a variable that has a length data type.
  2. It is use to store non-Unicode characters.
  3. It Occupy 1 byte of space for each character.

Nvarchar:- 
  1. It is a variable that has length data type.
  2. It is use to store Unicode characters.
  3. It Occupy 2 bytes of space for each character.

Char:-
  • It is a fixed length data type
  • Used to store non-Unicode characters
  • Occupiers 1 byte of space for each character

Drop down list asp.net C# from database

ddlPositions.SelectedValue = dt.Rows[0]["PostHeld"].ToString();



ddlTypeOfCourt.SelectedValue= courtApplicationDatesDTO.CourtTypeId.ToString();



selectedvalue will work


selecteditem.value will not work on above


but when we set the value to object from drop down selecteditem.value will work as below


courtApplicationDatesDTO.CourtTypeId =  Convert.ToInt32(ddlTypeOfCourt.SelectedItem.Value);

 https://www.c-sharpcorner.com/UploadFile/0c1bb2/fill-Asp-Net-dropdown-list-from-database-table-using-Asp-Net/


https://www.aspsnippets.com/Articles/Bind-Populate-ASPNet-DropDownList-using-DataTable-DataSet-in-C-and-VBNet.aspx

Grid edit and update facility in asp.net C#

 https://www.c-sharpcorner.com/UploadFile/1e050f/edit-and-update-record-in-gridview-in-Asp-Net/


or


<asp:GridView ID="grd_Batch" AutoGenerateColumns="false" runat="server" DataKeyNames="Batch_id"

            AllowPaging="true" PageSize="20" PagerSettings-Position="Bottom" PagerSettings-PageButtonCount="10"

            Width="100%" CssClass="table table-bordered table-hover table-stripped table-condensed table-responsive"

            OnRowEditing="grd_Batch_RowEditing" OnRowCancelingEdit="grd_Batch_RowCancelingEdit" OnRowDataBound="grd_Batch_RowDataBound"

            OnRowUpdating="grd_Batch_RowUpdating" OnRowDeleting="grd_Batch_RowDeleting" OnRowCommand="grd_Batch_RowCommand">

<Columns>

<asp:TemplateField HeaderText="EDIT">

                    <ItemTemplate>