1 Temmuz 2012 Pazar
4 Haziran 2012 Pazartesi
13 Ocak 2012 Cuma
12 Ocak 2012 Perşembe
WebUserControl Altından Default.aspx deki Kodu Çağırma
Selamlar tüm aspx kullanıcıları WebUserControlle işleri olmuştur. WebUserControl içine yerleştirdiğiniz bir butonun CodeBihend ile AnaSayfa içindeki bir Fonksiyonun nasıl çağrılacağını göstereceğim.
Default.aspx için codebehind foksuyonumuz;
public void ShowSepetBilgisi()
{
DataTable _tablo = (DataTable)Session["KULLANICISEPETI"];
lbSepetBilgisi.Text = "Şuan sepetinizde " + _tablo.Rows.Count.ToString() + " ürün bulunmakta.";
lbSepetBilgisi.Text += "ALPER";
}
WebUserControl içindeki Butonumuzun code-behind fonksiyonu ;
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
DataTable _tablo = (DataTable)Session["KULLANICISEPETI"];
DataRow _row = _tablo.NewRow();
_row["urunid"] = lbUrunID.Text;
_row["adet"] = ddlAdet.SelectedValue;
_tablo.Rows.Add(_row);
Session["KULLANICISEPETI"] = _tablo;
ddlAdet.SelectedIndex = 0;
this.Page.GetType().InvokeMember("ShowSepetBilgisi",
System.Reflection.BindingFlags.InvokeMethod, null, this.Page, new object[] {});
}
Burada gördüğünüz ;
this.Page.GetType().InvokeMember("ShowSepetBilgisi",
System.Reflection.BindingFlags.InvokeMethod, null, this.Page, new object[] {});
komutuyla Parent Page ( Default.aspx ) deki ShowSepetBilgisi fonksiyonumuzu Çağırabiliriz.
Mutlu Kodlar!
Default.aspx için codebehind foksuyonumuz;
public void ShowSepetBilgisi()
{
DataTable _tablo = (DataTable)Session["KULLANICISEPETI"];
lbSepetBilgisi.Text = "Şuan sepetinizde " + _tablo.Rows.Count.ToString() + " ürün bulunmakta.";
lbSepetBilgisi.Text += "ALPER";
}
WebUserControl içindeki Butonumuzun code-behind fonksiyonu ;
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
DataTable _tablo = (DataTable)Session["KULLANICISEPETI"];
DataRow _row = _tablo.NewRow();
_row["urunid"] = lbUrunID.Text;
_row["adet"] = ddlAdet.SelectedValue;
_tablo.Rows.Add(_row);
Session["KULLANICISEPETI"] = _tablo;
ddlAdet.SelectedIndex = 0;
this.Page.GetType().InvokeMember("ShowSepetBilgisi",
System.Reflection.BindingFlags.InvokeMethod, null, this.Page, new object[] {});
}
Burada gördüğünüz ;
this.Page.GetType().InvokeMember("ShowSepetBilgisi",
System.Reflection.BindingFlags.InvokeMethod, null, this.Page, new object[] {});
komutuyla Parent Page ( Default.aspx ) deki ShowSepetBilgisi fonksiyonumuzu Çağırabiliriz.
Mutlu Kodlar!
11 Aralık 2011 Pazar
ASPX HTML TÜRKÇE KARAKTER SORUNU
Server.HtmlDecode("Ahmet GÜNGÖR");
Ahmet GÜNGÖR olarak geri dönecektir.
Ahmet GÜNGÖR olarak geri dönecektir.
10 Aralık 2011 Cumartesi
gridview excel export
Response.Clear(); Response.AddHeader("content-disposition","attachment;filename=Test.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.Unicode; Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble()); System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw); FormView1.RenderControl(hw); Response.Write(sw.ToString()); Response.End();
Kaydol:
Kayıtlar (Atom)


HELIGAME