|
Hi All,
Another problem i've is how do i handle events in dynamic usercontrol.
Actually i've a User Review Form in which i'm saving data on submit click event but as soon i click on submit the page goes off... as the page is also a dynamic page so what do i do. Moreover the submit even doesn't work as no data is being saved. I tried with
Response.write but nothing comes on page.
So please help me with this.
Regards
Paritosh Tripathi
B.Tech. (C.S.)
BrainTechnosys Ltd.
|
|
|
|
|
Hi, please post your code.
Thanks
|
|
|
|
|
I am facing a very critical issue associated with AJAX asynchronous postback. I am really running short of time for releasing the product.
Let me explain the scenario here.
We are supposed to create a web application to export data fetched from database to an excel file and download at client machine. And as we have specific request from client to use ajax popup for implementing this, we have used Ajax Modal Popup and a progress bar to show the status of the process and a download link button to invoke download, both contained in Update Panel.
.Net Framework : 3.5
Ajax Version : 3.0.20229.0
We have implemented this as folows:
<contenttemplate>
<cc1:modalpopupextender id="PopUpModalPopupExtender" targetcontrolid="PopUpDiv" runat="server" xmlns:cc1="#unknown">
PopupControlID="pnlPopup" DropShadow="False">
<asp anel="" id="pnlPopup" runat="server">
<asp:image id="imgGlobalProcessing" runat="server" imageurl="~/App_Themes/MyApp/images/progress.gif" xmlns:asp="#unknown">
Progressing ...
|
br mode="hold" />
<asp:linkbutton id="hlnkExcel" runat="server" text="Excel" onclick="hlnkExcel_Click" xmlns:asp="#unknown">
<triggers> <asp:asyncpostbacktrigger controlid="hlnkExcel" xmlns:asp="#unknown">
--Code Behind--
private void ExportToExcel(DataSet dsExport, string[] sHeaders, string[] sFileds, ExportFormat FormatType, string FileName)
{
MemoryStream stream = new MemoryStream();
try
{
response.Clear();
if (FormatType == ExportFormat.CSV)
{
response.ContentType = "text/csv";
response.AppendHeader("content-disposition", "attachment; filename=" + FileName);
}
else
{
response.ContentType = "application/vnd.ms-excel";
response.AppendHeader("content-disposition", "attachment; filename=" + FileName);
}
XmlTextWriter writer = new XmlTextWriter(stream, Encoding.UTF8);
System.IO.StringWriter sw = new System.IO.StringWriter();
CreateStylesheet(writer, sHeaders, sFileds, FormatType);
writer.Flush();
stream.Seek(0, SeekOrigin.Begin);
XmlDataDocument xmlDoc = new XmlDataDocument(dsExport);
XslTransform xslTran = new XslTransform();
xslTran.Load(new XmlTextReader(stream), null, null);
xslTran.Transform(xmlDoc, null, sw, null);
//reads to a stream
byte[] byteArray = Encoding.ASCII.GetBytes(sw.ToString());
stream = new MemoryStream(byteArray);
// Buffer to read 10K bytes in chunk:
byte[] buffer = new Byte[10000];
// Length of the file:
int length = 0;
// Total bytes to read:
long dataToRead = 0;
dataToRead = stream.Length;
response.Cache.SetCacheability(HttpCacheability.Private);
response.Expires = -1;
response.Buffer = false;
length = stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
response.OutputStream.Write(buffer, 0, length);
response.Flush();
stream.Close();
response.Close();
}
catch (ThreadAbortException Ex)
{
string ErrMsg = Ex.Message;
}
catch (Exception Ex)
{
throw Ex;
}
finally
{
if (stream != null)
{
//Close the file.
stream.Close();
}
response.Close();
}
}
But while running the application we are getting the following error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
As a solution for this I tried different techniques which i have listed below.
1. Set EnableEventValidation=false for the Page.
2. In the Application error event i put the Context.ClearErrors()
3. Disabled the cacheRolesInCookie in roleManager in Web.config
4. Used the Response.outputstream.write() instead of Response.Write() method
5. Cretae an iframe in the ascx control
I am really finding myself in a helpless situation. I would really appreciate any help on this.
Thanks in advance
Regards
Lini
|
|
|
|
|
hi
plz anyone in this fourm able tohelp me
My problem
i m constucting multilevel marketing project(mlm).So need to construct binary tree.i hav a database in sql server.in database i hav parent id and child id of all member.i want to display this tree so that every member an able to show there all child member.plz give me code or logic to diplay this tree.
thanks in advance
|
|
|
|
|
Any_India wrote: multilevel marketing project(mlm).
Oohh! A pyramid scheme.
If you are using SQL Server 2008 use the HierarchyID type - that is designed exactly for what you want.
If this doesn't help then I suggest you ask in the correct forum. You asked a database question, not an ASP.NET question.
|
|
|
|
|
actualy i need to display tree in asp.net page where i will provide parent and child name or id.i need the logic to traverse and disply tree with member name...tree like bellow
|
|
|
|
|
Hi Friends,
I'm using ASP.net 2.0 with VB. I want to create Horizontal menu with submenu that open verticully.
Problem :
1.But problem in frame.. if i'm taking frame then the length of frame became same length of vertical menu ....
2.Also I want call one page of that include menu code & I called the page at all pages so my time & code reduce
Please reply me as soon as possible...
On my mail address : pranav.kalyani@gmail.com
PK
|
|
|
|
|
Pranav Kalyani wrote: 1.But problem in frame.. if i'm taking frame then the length of frame became same length of vertical menu ....
are putting menu control inside IFrame ? Why ?
Pranav Kalyani wrote: Also I want call one page of that include menu code & I called the page at all pages so my time & code reduce
Pranav Kalyani wrote: Please reply me as soon as possible...
On my mail address : pranav.kalyani@gmail.com
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi, you can use Menu or Sitemappath under navigation tool.
why you want to input your menu in a frame?
|
|
|
|
|
just check the properties and don't put in frame. and don't think so. think little it so simple.
with best
j somasekhar
|
|
|
|
|
Dear friends
i have gridview with (one textbox ,dropdownlist,checkbox) , one add button and save btn in aspx form
initially gridview will not show any values , when user clicks Add button , gridview will show textbox ,dropdownlist and checkbox with blanks .
after user will fill up these fields , next when user wants one more row again he will click add button , then it will create new row in gridview with blank fields. finally he will click save button then grid values will be stored in database. for example
Empname(txt) Dept(ddl) Active(checkbox)
-- --- --
xyz Purchase Yes
Add btn Save btn
any body help me regarding this issue?
|
|
|
|
|
when u add each row, add it to a datatbale and finally on the click of the save button, take each row from the datatable and insert it into db.
add the below code in add button click,
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Number", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
if (ViewState["data"] != null)
dt = (DataTable)ViewState["data"];
DataRow dr = dt.NewRow();
dr["Number"] = this.TextBox1.Text;
dr["Name"] = this.TextBox2.Text;
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
ViewState["data"] = dt;
and in save button
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Number", typeof(string)));
dt.Columns.Add(new DataColumn("Name", typeof(string)));
if (ViewState["data"] != null)
dt = (DataTable)ViewState["data"];
foreach (DataRow dr in dt.Rows)
{
code to insert in db
}
hope it helps u
|
|
|
|
|
1. Create a DataTable with the following columns Id, Ename, DeptNo, Status(Active/Inactive) with empty rows. Store this DataTable in Session.
2. Bind this DataTable to the GridView. As initially no rows in the DataTable , The GridViewwill be empty.
3. In the GridView RowBound event, Bind DeptNo Dropdown and Status checkbox controls with your data for each row of the DataTable.
4. On clicking add button, Update the changes done in the Gridview to the DataTable and then add an empty row to that DataTable. Again bind this DataTableto GridView. So whenever you click add button, the GridView will have a new row.
Hope this will address your requirement.
|
|
|
|
|
Hi,
I my page i have create two text box which is created by DYNAMICALLY,
Like as below,
dim txt as textbox
dim plc as placeholder
plc.control.add(txt)
So text box is created sucessfully, but i wat to validate the two text box should not be null from Client side when click the button control .
function fnNotNull()
{
var frm = document.getElementById"ContentPlaceHolder1_txtfromdate").id;
var to =
document.getElementById("ContentPlaceHolder1_txttodate").id;
alert(frm.value);
alert(to.value);
return;
}
finally when i click the button it return "undefined" error, not return value of the text box, how to take the value of the text box from client side. If any one know plz answer me....
kannak
|
|
|
|
|
Get the UniqueID of dynamic textbox and use it in your javascript.
Hope this will help you.
|
|
|
|
|
Try this:
function fnNotNull()
{
var frm = document.getElementById"ContentPlaceHolder1_txtfromdate");
var to =
document.getElementById("ContentPlaceHolder1_txttodate");
alert(frm.value);
alert(to.value);
return;
}
|
|
|
|
|
Can i get free template to create my own site..
Thank you !!!
|
|
|
|
|
Hi, yes you can. Theres a lot of free web template for free in the net
|
|
|
|
|
Thank you for the reply..I tried but didn't find.. If possible can i get few links..
I will appreciate your effort.
|
|
|
|
|
Hi, thanks for your reply and sorry for late reply.
<a href="http://www.freewebtemplates.com/">www.freewebtemplates.com/</a>[<a href="http://www.freewebtemplates.com/" target="_blank" title="New Window">^</a>]
<a href="http://www.freewebsitetemplates.com">www.freewebsitetemplates.com</a>[<a href="http://www.freewebsitetemplates.com" target="_blank" title="New Window">^</a>]
<a href="http://www.steves-templates.com/">www.steves-templates.com/</a>[<a href="http://www.steves-templates.com/" target="_blank" title="New Window">^</a>]
<a href="http://www.freetemplatesonline.com/">www.freetemplatesonline.com/</a>[<a href="http://www.freetemplatesonline.com/" target="_blank" title="New Window">^</a>]
Hope this one can help
Thanks
|
|
|
|
|
Hi,
i want to implement an efficient gridview...i have about 1500 rows and it takes time to load into a gridview (with automatic paging), so i want to implement a custom paging scheme in which i show only 100 rows at a time... i have turned on paging, pulled out count for the rows, also pulled out 100 rows but Q1. how do i make gridview generate 15pages link (100 per page,15 pages)... Q2.how would i call the second page with 100 -200 rows.... Please help, ...with question1 especially... also i am binding the gridview at runtime to different tables...i think i am using about 4 different types of tables... so i can't use datasources etc...
please help
haseeb
|
|
|
|
|
Hi,
for the Q1:
Set your Grid property allowpaging=true and pagesize=100
for the Q2:
in your Grid_pageindexchaging:
Grid1.pageindex=e.newpageindex
Grid1.Datasource=dt (your datatable)
Grid1.Databind()
Hope this one can help.
Thanks
|
|
|
|
|
hi...
thanx for ur response... i have already done this and the problem with this is that it isn't efficient... in such example the grid only shows 100 rows but datasource has all data in it... wat i am trying to do is to get count of the no. of rows , somehow make grid generate appropriate page numbers and then pull out only 100 rows at a time... then on pageindexchanging, take get the page index, select another 100 rows this time rows from 100-200...
I think,i have explained my problem... if not, lemme know and i will try my best to retype something that makes sense..
thanx...
regards
haseeb
|
|
|
|
|
the copy website does not work
what can be done????
|
|
|
|
|
What error are you getting??
Im having problems with the copy web site tool as well
At the end, i get an error saying that it had problems, but does upload the file, it only takes too much time, and im using vs2008 professional
Alexei Rodriguez
|
|
|
|