System.Web.UI.HtmlControls.HtmlTable tbl = (System.Web.UI.HtmlControls.HtmlTable)ctrlStorage.FindControl("CalnderDiv");
Wednesday, November 30, 2011
Thursday, November 17, 2011
Wednesday, August 17, 2011
How to make button Default button when hit enter key
// Button1 is the ID of button.
// form1 is the ID of form tag which is in master page.
(Page.Master.FindControl("form1") as HtmlForm).DefaultButton = this.Button1.UniqueID;
// form1 is the ID of form tag which is in master page.
(Page.Master.FindControl("form1") as HtmlForm).DefaultButton = this.Button1.UniqueID;
Wednesday, July 27, 2011
Set AutoIncrement to "0"
USE NopNew;
GO
DBCC CHECKIDENT ("Nop_Picture", RESEED, 0);
GO
//nopnew is the database name
// nop_picture is the table name
Friday, July 1, 2011
How to Store .CSV file in Sql Server
CREATE TABLE CSVTestNewTest
(
[Offer Ref] Nvarchar (255),
[Quote Ref] Nvarchar(100),
[Midwich Part] Nvarchar(200),
[Midwich Part Description] Nvarchar(200),
[Minimum] nvarchar(50),
[Qty] nvarchar(200),
[Free Part Description] nvarchar(max),
[Offer Description] nvarchar(max),
[Type] nvarchar(100),
[Available Qty] nvarchar(200)
)
GO
BULK
INSERT CSVTestNewTest
FROM 'D:\varun\Project Assets\Qb Assets\Qb Assets\Data Feed 30june11\data\free_parts.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
Description: first of all create table of all the column available in excel or csv file. then with the bulk insert statement give the location where your excel or csv file is stored and exceute the query with syntax describe above.
Monday, June 6, 2011
Show Progress bar
<script language="javascript" type="text/javascript">
function success_handler(o) {
replace_html('content', o.responseText);
}
function replace_html(id, content) {
document.getElementById(id).innerHTML = content;
}
function show_progressbar(id) {
//replace_html(id, '<img src="" border="0" alt="Loading, please wait..." />');
replace_html(id, '<asp:label id="aa" runat="server" text="Loading,please wait....." style="border:none;font-size:12px;font-weight:bold;" />');
}
function send_request() {
show_progressbar('content');
var callback = { success: success_handler };
}
</script>
<div id="content" align="center">
</div>
// this button will call the "send_request( )"
<asp:Button ID="btn_submit" OnClientClick="javascript:send_request();" Text="Search" runat="server" Width="120px" />
Tuesday, May 31, 2011
Read XML Node Value
foreach (XmlNode node1 in nodec.ChildNodes)
{
if (node1.Name == "STATUS")
{
for (int i = 0; i < node1.Attributes.Count; i++)
{
if (node1.Attributes[i].Name == "type")
{
statustype = node1.Attributes[i].Value;
}
}
foreach (XmlNode node2 in node1.ChildNodes)
{
if (node2.Name == "subTransId")
{
subtransId = node2.InnerText;
}
}
}
if (node1.Name == "CONTENT")
{
foreach (XmlNode node2 in node1.ChildNodes)
{
if (node2.Name == "DECISION")
{
foreach (XmlNode node3 in node2.ChildNodes)
{
if (node3.Name == "SCORES")
{
foreach (XmlNode node4 in node3.ChildNodes)
{
if (node4.OuterXml.Contains("CLV:INQ"))
{
if (node4.InnerText != "" || node4.InnerText != "0")
{
score = node4.InnerText;
}
else
{
score = "Denied";
}
}
}
}
}
}
}
}
}
Wednesday, May 25, 2011
Get Child Control on page (Usercontrol textbox in default page)
TextBox txtdrop1 = (TextBox)Multiselectdropdown3.FindControl("tbm");// Multiselectdropdown3 is the ID of UserControl
// tbm is ID of the textbox available in UserControl.
Get Form value on Postback c#
System.Text.StringBuilder displayValues =
new System.Text.StringBuilder();
System.Collections.Specialized.NameValueCollection
postedValues = Request.Form;
String nextKey;
for (int i = 0; i < postedValues.AllKeys.Length; i++)
{
nextKey = postedValues.AllKeys[i];
if (nextKey.Substring(0, 2) != "__")
{
displayValues.Append("<br>");
displayValues.Append(nextKey);
displayValues.Append(" = ");
displayValues.Append(postedValues[i]);
}
}
Friday, May 20, 2011
Resize grid on Browser resize
//ctl00_ContentPlaceHolder1_RadGrid_List_GridData .(this is grid ID).
//ctl00_ContentPlaceHolder1_grdview_GridData (second grid id)
<script>
jQuery(document).ready(function(){
jQuery(window).resize(function(){
var orignalHeight = parseInt($(window).height());
var newHeight = (orignalHeight/25)*8;
var containterHeight = parseInt($("#ctl00_ContentPlaceHolder1_RadGrid_List_GridData").height());
$('#ctl00_ContentPlaceHolder1_RadGrid_List_GridData').css('cssText', 'height: '+newHeight+'px !important');
$("#ctl00_ContentPlaceHolder1_RadGrid_List_GridData").css({'overflow':'auto','width':'100%'});
//alert($("#ctl00_ContentPlaceHolder1_RadGrid_List_GridData").height());
var secContainerHeight=parseInt($("#ctl00_ContentPlaceHolder1_grdview_GridData").height());
$('#ctl00_ContentPlaceHolder1_grdview_GridData').css('cssText','height:'+newHeight+'px !important');
$("#ctl00_ContentPlaceHolder1_grdview_GridData").css({'overflow':'auto','width':'100%'});
});
});
</script>
Friday, January 14, 2011
Jquery datepicker with blackout dates
// code for .aspx page
<html>
<head>
<title></title>
<link href="css/datepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!-- required plugins -->
<script type="text/javascript" src="scripts/date.js"></script>
<!--[if IE]><script type="text/javascript" src="scripts/jquery.bgiframe.js"></script><![endif]-->
<!-- jquery.datePicker.js -->
<script src="scripts/datepicker.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('.date-pick')
.datePicker(
{
createButton: false,
renderCallback: function ($td, thisDate, month, year) {
if (thisDate.isWeekend()) {
$td.addClass('weekend');
$td.addClass('disabled');
}
}
}
)
.bind('click',
function () {
$(this).dpDisplay();
this.blur();
return false;
}
)
.bind('dateSelected',
function (e, selectedDate, $td) {
console.log('You selected ' + selectedDate);
}
);
});
</script>
</head>
<body>
Date<input type="text" name="datepicker" id="datepicker" class="date-pick" />
</body>
</html>
// you can get files from Here click here for datapicker.js
click here for css file
click here for .date.js file
<html>
<head>
<title></title>
<link href="css/datepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!-- required plugins -->
<script type="text/javascript" src="scripts/date.js"></script>
<!--[if IE]><script type="text/javascript" src="scripts/jquery.bgiframe.js"></script><![endif]-->
<!-- jquery.datePicker.js -->
<script src="scripts/datepicker.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('.date-pick')
.datePicker(
{
createButton: false,
renderCallback: function ($td, thisDate, month, year) {
if (thisDate.isWeekend()) {
$td.addClass('weekend');
$td.addClass('disabled');
}
}
}
)
.bind('click',
function () {
$(this).dpDisplay();
this.blur();
return false;
}
)
.bind('dateSelected',
function (e, selectedDate, $td) {
console.log('You selected ' + selectedDate);
}
);
});
</script>
</head>
<body>
Date<input type="text" name="datepicker" id="datepicker" class="date-pick" />
</body>
</html>
// you can get files from Here click here for datapicker.js
click here for css file
click here for .date.js file
Subscribe to:
Comments (Atom)