Tuesday, July 03, 2007
Addru, chennagive omme odi nodi.
Love Maadu, aadre Life miss Maadkobeda..
Feel Aagu, but Future halu Maadkobeda..
Think maadu, but Time waste Maadkobeda..
Aaata aadu, aadre.. "HUDUGAATA " aadabeda...
Sakkath majappa life andre,
dodda paata kalside lifeu,
talent ide, use illa,
buddi ide, dudd illa,
chennagidini, smart aagilla,
awnajji, naanu sattu, heege mele hodmele, awnge ondu gati kaansteeni nodtaa iri
alli mele kutkondu aata aadtaane, HUDUGAATA...
2007 Lovers Bhavishya:
Lovalli, Huduga Deep aadre-"MUNGAARU MALE"
Hudugi Deep aadre, "DUNIYA"
Huduga Hudugi ibrru Deep aadre, ade " HUDUGAATA "
Converting DataView to Table - ADO.NET Tutorials : http://davidhayden.com/blog/dave/archive/2006/02/11/2798.aspx
if (strTripType.Equals("BV"))
{
dvFTRList = new DataView(dtFTRList, "TVISA = 'BV' or TVISA = 'B1'", "TVISA", DataViewRowState.CurrentRows);
}
else
{
dvFTRList = new DataView(dtFTRList, "TVISA <> 'BV' and TVISA <> 'B1'", "TVISA", DataViewRowState.CurrentRows);
}
1. Copy the coding into the BODY of your HTML document
<_body>
<_div align="center">
<_script language="JavaScript">
_document.write('<_form><_input type="button" value="Refresh" onclick="history.go()">')
<_p><_center><_font style="font-family:arial, helvetica;">Free JavaScripts provided<_br>by <_a href="">the/'>http://javascriptsource.com">The JavaScript Source<_p>
check out this: http://codebetter.com/blogs/john.papa/archive/2005/03/30/ADO-NET-2-DataTable-Merge.aspx
whenever u have 2 drop downs in a gridview and wanna bind one drop down due 2 post back of otheruse this
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
{
string foundID = String.Empty;
GridViewRow row = (GridViewRow)((sender) as Control).NamingContainer;
// get the value from the first dropdownlist
DropDownList ddlFirst = ((sender) as DropDownList);
int ddlFirstSelectedValue = Convert.ToInt32(ddlFirst.SelectedValue);
string firstDropDownListID = ddlFirst.UniqueID;
// and now here is how
DropDownList ddlSecond = row.FindControl("ddl2") as DropDownList;
// now from here you can do whatever you want!
}
You could use the DateTime.ParseExact() method to convert the date string into a DateTime instance:
Format SAP DateTime String to dd-MMM-yyyy?
string sapDate = ...
DateTime date = DateTime.ParseExact(sapDate, "yyyyMMdd", new System.Globalization.DateTimeFormatInfo());
string myString = date.ToString("MM/dd/yyyy");
Afterwards, use DateTime.ToString() method to convert it back to a string in the format you need.
If someone should experience the same problem, I've found the solution.
The behaviour happens if you use wildcard mapping in IIS and the default page for the root folder of the application inherits from a custom Page type.
Here are workarounds:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=105061
and here the ms patch
http://support.microsoft.com/?scid=kb%3Ben-us%3B911300&x=11&y=10
Adding new row to a grid view, offcourse with a post back is pretty simple. All u have to have is atlas tool installed, ie ajax extender tool installed.
Drag a Update panel from ajax tool kit and drop ur grid view on the same. Update panel feature is that, post back shall happen with only the panel controls and seems like there was actually no post back at all.
Code below is the example which clearly explains update panel :)
ASPX page
<_body>
<_form id="form1" runat="server">
<_asp:scriptmanager id="ScriptManager2" runat="server">
<_asp:updatepanel runat="server" id="UpdatePanel1" updatemode="Conditional"> <_contenttemplate>
<_div style="background-color: Lime; width: 100px;">
<_asp:label id="PartialPostBackLabel" runat="server">
<_asp:button id="PartialPostBackButton" runat="server" text="Partial Post Back" onclick="PartialPostBackButton_OnClick">
<_asp:gridview id="grdvShortTermFTRs" runat="server" autogeneratecolumns="False" pagesize="5" showfooter="True">
<_columns>
<_asp:hyperlinkfield headertext="FTR No." text="Testing" datatextfield="test1" datanavigateurlfields="test1" datanavigateurlformatstring="~/Default.aspx?FTRNo={0}">
<_itemstyle width="75px">
<_asp:boundfield headertext="Employee No." datafield="test2"> <_itemstyle width="75px">
<_asp:boundfield headertext="Name" datafield="test3">
<_itemstyle width="125px"> <_asp:boundfield headertext="Country" datafield="test4">
<_itemstyle width="75px">
Code Behind
public partial class Default2 : System.Web.UI.Page
{
public static int intRowCount;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{ intRowCount = 3; bindGridView();
}
}
protected void bindGridView()
{
DataTable dt = new DataTable();
DataColumn testcolumn1 = new DataColumn("test1");
DataColumn testcolumn2 = new DataColumn("test2");
DataColumn testcolumn3 = new DataColumn("test3");
DataColumn testcolumn4 = new DataColumn("test4");
dt.Columns.Add(testcolumn1); dt.Columns.Add(testcolumn2); dt.Columns.Add(testcolumn3); dt.Columns.Add(testcolumn4);
for (int i = 0; i < intRowCount; i++)
{
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
}
grdvShortTermFTRs.DataSource = dt;
grdvShortTermFTRs.DataBind();
}
protected void PartialPostBackButton_OnClick(object sender, EventArgs e)
{
intRowCount++; bindGridView();
}
}
Reference: http://www.codeproject.com/books/net2_cs2_newfeatures.asp
Wednesday, May 30, 2007
Devaranegu heltini...., "Mungaaru Male" na naanu 3 saari nodidagalu intha olle remix aitade adondu dialogueu antha andkondirodirli, adra sulivu irlilla nanage. Aadre ,nenne taane idanna nodide kanri...., satttogo astu nagu bandbidtu. Probably, nandu gatti jeeva adakke saaililla, adu secondary.
Idanne blognalli haakona antha haakta idini...., nothing offending plzzzzzzz :)
"Nivu nan kaili keyskondilla antha nange bejarilla kanri. Nim Thika, Nim Thode, Nim Sonta, Nivu baggidaaga nodida aa moley saaku kanri. Adanne rewind maadi maadi jatka hodkondu nan life na thalli bidthini kanri. Adre ondu vishya thilkolri nimma aa nagna deha nenskondu naanu jatka hodkolvastu bere yaaru hodkolalla kanri. Nan thunne murdogli, kithkond kai ge barli, naan satthru jatka hodkolthane irthini kanri!!!! [:D] "
Thursday, May 24, 2007
Feature changes in asp.net 2.0
http://msdn2.microsoft.com/en-us/library/aa479401.aspx
Understanding page inheritance in asp.net 2.0
http://west-wind.com/weblog/posts/3016.aspx
The Code Models of ASP.NEt 2.0 (abt partial classes) http://www.odetocode.com/Articles/406.aspx
Monday, May 21, 2007
Check this......., vvvvvv important concept
http://msdn2.microsoft.com/en-us/library/ms998306.aspx
here is a good sample to pop up a server calendar control rather than use any javascript calendar control
http://www.15seconds.com/issue/040315.htm
if you want to use javascript calendar.. than check out this cool skinned calendar (dhtml) which can be used...
http://www.dynarch.com/projects/calendar/
There is a Calendar control in AJAX tool kit, it is a perfect one.
How Do I: Configure the ASP.NET AJAX Calendar Control?
Execute the below code in page_load event
_System.Text.StringBuilder sbValid = _new _System.Text.StringBuilder();
sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sbValid.Append("if (Page_ClientValidate() == false) { return false; }} ");
sbValid.Append("this.value = 'Please wait...';");
sbValid.Append("this.disabled = true;");
sbValid.Append("document.all.btnSubmit.disabled = true;");
//GetPostBackEventReference obtains a reference to a client-side script function that causes the server to post back to the page.
sbValid.Append(this.Page.GetPostBackEventReference(this.btnSubmit));
sbValid.Append(";");
_this.btnSubmit.Attributes.Add("onclick", sbValid.ToString());
Where btnSubmit is a simple asp button
I need to read Html source of a Web From at Server -- Copy the whole html source code before actually rendering it
<%@ _Page Language="C#" _AutoEventWireup="true" _CodeFile="RenderPageToHtml.aspx.cs" _Inherits="RenderPageToHtml" _Trace="true" %>
<_head runat="server"> <_title>Untitled Page<_body>
<_form id="form1" _runat="server"> <_div> <_asp:_textbox id="TextBox1" runat="server" height="414px" textmode="MultiLine" width="198px"> <_asp:_button id="Button1" runat="server" text="Button"> <_asp:_linkbutton id="LinkButton1" runat="server">LinkButton using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class RenderPageToHtml : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (Session["text"] != null) { TextBox1.Text = Session["text"].ToString(); } } protected override void Render(HtmlTextWriter writer) { System.IO.MemoryStream mem = new System.IO.MemoryStream(); System.IO.StreamWriter twr = new System.IO.StreamWriter(mem); System.Web.UI.HtmlTextWriter myWriter = new HtmlTextWriter(twr); base.Render(myWriter);
myWriter.Flush(); myWriter.Dispose();
System.IO.StreamReader strmRdr = new System.IO.StreamReader(mem); strmRdr.BaseStream.Position = 0; string pageContent = strmRdr.ReadToEnd(); strmRdr.Dispose(); mem.Dispose(); Session["text"] = pageContent; writer.Write(pageContent); }}
Reference: http://forums.asp.net/t/1112091.aspx
Hi,
To convert excel to XML see:
http://www.codeproject.com/office/excel2xml.asp
To convert CSV to XML see:
http://blogs.msdn.com/kaevans/archive/2003/04/17/5780.aspx
(It is not writed via ASP.NET, but you can refer it.)
To convert excel to csv see:
http://www.devasp.net/net/articles/display/141.html
string Name = _TextBox1.Text;
string Surname = _TextBox2.Text;
SqlDataSource userQuizDataSource = new SqlDataSource(); userQuizDataSource.ConnectionString =
ConfigurationManager.ConnectionStrings["Demo_DBConnection"].ToString(); userQuizDataSource.InsertCommand = "INSERT INTO [Student] ([Name], [Surname]) VALUES (@Name,@Surname)";
userQuizDataSource.InsertParameters.Add("Name", Name); userQuizDataSource.InsertParameters.Add("Surname", Surname); userQuizDataSource.Insert();