PDA

View Full Version : [CLOSED] Problem with ascx



flaviodamaia
Nov 06, 2008, 10:22 AM
I'm using LINQ to Entities... and I have a problem to pass the values of the window.ascx for the Save method at the ascx.cs.
Where is going with null values for method Save. What I do?

This is my method save in ascx.cs:


protected void btn_salvar_Click(object sender, EventArgs e)
{
if ((this.ctgDescription.Text != "")&&(this.ctgDescription.Text != null))
{
using (DMGDocEntitie context = new DMGDocEntitie())
{
Category ctg = new Category();
ctg.ctgDescription = this.ctgDescription.Text;
CategoryRN.add(ctg); //Get values and save in database.
this.ctgDescription.Text = "";
}
}
else
{
Response.Write("<script>alert('Saving Error!');</script>");
}
}



Please a need help!!!

Thanks for attention!

Vladimir
Nov 06, 2008, 10:37 AM
Hi,

Why do you use StateProvider="None" in ScriptManager?

Set it to StateProvider="PostBack"

flaviodamaia
Nov 06, 2008, 1:38 PM
Problem solved.


Thanks for help vladimir!