|
Thanks for the reply.
Acctually it is just a doubt in the mind, i could do it in sevral manners, i just want to know what is the problem in doing the same in this manner.
Regards
Yogesh Agarwal
|
|
|
|
|
ASP.NET is stateless ... which means it doesnt maintain the state of its objects ... on each request and response cycle the page is treated as something new and for the first time ... thats why state management in ASP.NET is a challenge ...
The code you provided should work on Windows Application because it maintains the state of its object ... but here each time you click the button the page is reinitialized with its variables you declared ..to solve such a problem read about maintaining objects states using Sessions and ViewStates in ASP.NET
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Thanks for the answer,
Means in every pageload or postback the objects were destroyed we defined in ASP.NET,
And does it works fine if i use ajax.
Regards
Yogesh Agarwal
|
|
|
|
|
Actually AJAX has nothing to do with the main life cycle of a page ... for the scope you are talking about its only the server side .. and there where you are concerned about the life cycle of page.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
I've got some labels in Gridview2 that I allow the user to drop into text boxes in Gridview1 and it would change the textbox information to label information.
Initially i drag a label onto the text box and the value of textbox changes to label info, if i drag different label onto the same text box it will just append to the existing text and i am not able to override the text in textbox.
i am using VS2005 with Ajax extensions.
Plz help to override the value in textbox
Thanks in Advance.
modified on Thursday, November 20, 2008 6:19 AM
|
|
|
|
|
Hi everyone can anybody tell me how compatible asp.net project with apache 2.2....we r planning to host website using asp.net with Apache webserver...does this works? if yes can u tell me hw can i implement it...? if no please tell me the reason and in which way it can be implemented....
Thanks in advance..
|
|
|
|
|
|
wht abt mod_aspdotnet.so....i saw in website they used mod_aspdotnet.so n its working fine but am nt sure abt the security level...so can anyone tell me is it safe? and Abt mono i don have any idea...i have to try...
|
|
|
|
|
Sorry ! I don not have idea. But These all stuff you can ask in Mono Forum. That would be better.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
oh thank you very much...
|
|
|
|
|
hi,
I am facing a problem with authentication in IIS.I have to use a COM componet that internally takes the logged in users information and if that user is valid then we can make calls to COM.I developed a windows application and its takes logged in user information and works fine.Later we decided to make it as a webservice there the problem started.If we run the webservice in Visual studio's webserver its works fine after moving to IIS the COM component is not able to get the logged in user information and stops working.
Hosted in IIS with anonymous disabled and enabled windows authentication even i tried with Impersonation but no luck.
if all works fine finally i have to make it as a WCF service.
Please helpe me on this issue..
Regards
Rajeev G
|
|
|
|
|
It appears that the print button does not show in a report viewer with the processing mode set to local. How would I process the report viewer to either print or to open a new window with the contents in a printable page? Would it be ReportViewer1.Render? I am learning this new control and am not familiar with that method or if that would even work.
Thanks
Revolutionary: Disk drives go round and round.
|
|
|
|
|
I can answer you regardin the render method ... you probably meant the ReportViewer.LocalReport.Render method ... well its the main method in the ReportViewer Control ... this method uses the report definition (which is an xml format stored in rdlc file referring to the report) to render the report defintion with its data to the ASP.NET page ... the LocalReport will have the definition and its integrated with the stored procedure or the datasource ... then using some parameters to the render method you get an array of bytes which is the output you want ...
Take a look at the code below:
string format="PDF";
Warning[] warnings;
string[] streamIDs;
string mimeType;
string encoding;
string extension;
string deviceInfo = "<deviceinfo><simplepageheaders></simplepageheaders></deviceinfo>";
byte[] buffer = viewer.LocalReport.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamIDs, out warnings);
this.Response.Clear();
this.Response.AddHeader("Content-Type", mimeType);
this.Response.AddHeader("Content-Disposition", "attachment; filename=" + reportName + "." + extension);
this.Response.BinaryWrite(buffer);
this.Response.End();
The above code will render the specified local report as PDF and return the result as an array of bytes ... then you write this array of bytes to back to the response as a dialog of Open or Save ...
I needed this trick in a project and it worked fine with me ... I could render the report to PDF Excel or whatever I can to be as the user can just download easly.
Hope this could help ...
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
I will definitely give it a shot. Thank you!
Revolutionary: Disk drives go round and round.
|
|
|
|
|
Ok, here is what I really what to do. How to I hide the DistributorID when loaded but display it when the excel file is exported.
You might be thinking why don't I delete it form the page_load then, well I can't do that cause then my cells will not match up to the database
to the LinkButton1_Click event
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class manager_view_distributors : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AlternaDB.MarketingDataContext db = new AlternaDB.MarketingDataContext();
var products = from p in db.Distributors
select new { p.DistributorID, Company_Name = p.CompanyName, Address = p.AddressLine1, p.City, Zip_Code = p.ZipCode, p.State, First_Name = p.Contact1FirstName, Last_Name = p.Contact1LastName, Area_Code = p.Contact1WorkAreaCode, Phone = p.Contact1WorkNumber, Num_Stores = p.NumStores, Num_DSC = p.NumDsc };
GridView1.DataSource = products;
GridView1.DataBind();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.PageSize = Int32.Parse(DropDownList1.SelectedValue); this.GetData();
}
private void GetData()
{
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
this.GetData();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (this.rdoBtnListExportOptions.SelectedIndex == 1)
{
// the user wants all rows exported, turn off paging
// and rebing the grid before sending it to the export
// utility
ExportExcelColumns();
this.GridView1.PageSize = 1000000;
GridView1.DataBind();
}
else if (this.rdoBtnListExportOptions.SelectedIndex == 2)
{
// the user wants just the first 100,
// adjust the PageSize and rebind
ExportExcelColumns();
this.GridView1.PageSize = 100;
GridView1.DataBind();
}
//Current Page export
else if (this.rdoBtnListExportOptions.SelectedIndex == 0)
{
ExportExcelColumns();
GridView1.DataBind();
}
GridViewExportUtil.Export("Customers.xls", this.GridView1);
}
private void ExportExcelColumns()
{
// pass the grid that for exporting ...
AlternaDB.MarketingDataContext db = new AlternaDB.MarketingDataContext();
var dist = from d in db.Distributors
select new
{
d.DistributorID,
AccountType = SalonForm.DistAccountType.GetDistAccountTypeByValue((int)d.AccountType),
AccountStatus = SalonForm.AccountStatus.GetAccountStatusByValue((int)d.AccountStatus),
d.CompanyName,
d.AddressLine1,
d.AddressLine2,
d.City,
d.State,
d.Country,
d.ZipCode,
d.Territory,
d.NumDsc,
d.NumStores,
d.Website,
Contact1Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact1Type),
d.Contact1FirstName,
d.Contact1LastName,
d.Contact1Email,
d.Contact1WorkIntlPrefix,
d.Contact1WorkAreaCode,
d.Contact1WorkNumber,
d.Contact1WorkExtension,
d.Contact1CellIntlPrefix,
d.Contact1CellAreaCode,
d.Contact1CellNumber,
d.Contact1CellExtension,
d.Contact1ReceiveEnews,
Contact2Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact2Type),
d.Contact2FirstName,
d.Contact2LastName,
d.Contact2Email,
d.Contact2WorkIntlPrefix,
d.Contact2WorkAreaCode,
d.Contact2WorkNumber,
d.Contact2WorkExtension,
d.Contact2CellIntlPrefix,
d.Contact2CellAreaCode,
d.Contact2CellNumber,
d.Contact2CellExtension,
d.Contact2ReceiveEnews,
Contact3Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact3Type),
d.Contact3FirstName,
d.Contact3LastName,
d.Contact3Email,
d.Contact3WorkIntlPrefix,
d.Contact3WorkAreaCode,
d.Contact3WorkNumber,
d.Contact3WorkExtension,
d.Contact3CellIntlPrefix,
d.Contact3CellAreaCode,
d.Contact3CellNumber,
d.Contact3CellExtension,
d.Contact3ReceiveEnews,
Contact4Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact4Type),
d.Contact4Firstname,
d.Contact4LastName,
d.Contact4Email,
d.Contact4WorkIntlPrefix,
d.Contact4WorkIntlAreaCode,
d.Contact4WorkNumber,
d.Contact4WorkExtension,
d.Contact4CellIntlPrefix,
d.Contact4CellAreaCode,
d.Contact4CellNumber,
d.Contact4CellExtension,
d.Contact4ReceiveEnews,
Contact5Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact5Type),
d.Contact5FirstName,
d.Contact5LastName,
d.Contact5Email,
d.Contact5WorkIntlPrefix,
d.Contact5WorkAreaCode,
d.Contact5WorkNumber,
d.Contact5WorkExtension,
d.Contact5CellIntlPrefix,
d.Contact5CellAreaCode,
d.Contact5CellNumber,
d.Contact5CellExtenstion,
d.Contact5ReceiveEnews,
d.DateCreated,
d.Username,
d.Password
};
GridView1.DataSource = dist;
}
protected void BrowseDistGrid_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void rdoBtnListExportOptions_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void LinkButton1_Click1(object sender, EventArgs e)
{
GridViewRow gvr = (GridViewRow)((LinkButton)sender).Parent.Parent; //get that selected row
//string AccountType = gvr.Cells[16].Text;
string CompanyName = gvr.Cells[2].Text;
string Address1 = gvr.Cells[3].Text;
Response.Redirect("Distributor.aspx?CompanyName=" + CompanyName
+ "&Address1=" + Address1
); //redirect to next page with selected values
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header | e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Controls[1].Visible = false;
}
}
}
|
|
|
|
|
Hi there...
I have couple of comments on your question:
First of all ... Haven't you notice that you have posted a newspaper here !!! This is not a good thing ... how many members do you think will read or read your post?! None !! because no one will have the time to read all this to figure out the problem you are posting and find a solution for you !!
Second of all ... When posting code in your question put it in code tags .. its easier for the readers to distinguish the question body from the code in the post.
We could help if you post a problem ... not a project to be rewritten all over again or something like that ... try to rewrite your problem so others could try to help you out.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Screw off no one what's to hear your compliants, get a life.
|
|
|
|
|
We're using ASP.NET 2.0 FormView control wrapped by a web user control to handle CRUD UI operations. It works well except for confirmation PRIOR to insert or update. All the links I find on "confirmation" are the response.redirect type after the insert has been made to database. I need to display the data to user one last time prior to insert.
Formview does not appear to have a mechanism for displaying a readonly template of insert/update data PRIOR to insert/update.
Tried Me.fvAccountCC.ChangeMode(FormViewMode.ReadOnly) but user input from viewstate doesn't appear in this mode
Any ideas before I start messy marshalling of user input to duplicate controls in <EmptyDataTemplate> using .FindControl across two instances of usercontrol/formview
ie.
Public Sub SetConfirmTemplate(ByVal Src As ctlAccountCC)
Me.fvAccountCC.DataSourceID = Nothing
CType(Me.fvAccountCC.FindControl("lblAccountName"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
CType(Me.fvAccountCC.FindControl("lblAccountNo"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
CType(Me.fvAccountCC.FindControl("imgCardType"), Image).ImageUrl = CType(Src.FormView.FindControl("imgCardType"), Image).ImageUrl
etc...
Thanks.
|
|
|
|
|
Can anybody help me in watermarking the images in DB With a specific text while storing or retrieving for display...
Thanks in Advance
|
|
|
|
|
This really has nothing to do with ASP.NET. It's pretty easy to do tho, surely there are articles on doing that on this site ? All you do is write something on top of the bitmap, typically I'd add that to the code that retrieves the bitmap in your data layer.
You create a graphics object from the bitmap and then you use the methods of that object to draw/write on it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
at napajax.Frm_Jobfinder2.getValue() in
|
|
|
|
|
This could be to do with the permission on the ASP.NET user, otherwise, it probably is not related to ASP.NET at all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
System.UnauthorizedAccessException: Access to the path 'C:\HostingSpaces\consultelvin\napsterjobs.com\wwwroot\resume\muskan22.doc' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at System.Web.HttpPostedFile.SaveAs(String filename)
at System.Web.UI.WebControls.FileUpload.SaveAs(String filename)
at napajax.Frm_Jobfinder2.ImageFileUplodad(String file, String rename)
|
|
|
|
|
ASP.NET does not allow you to access the file system beyond the root of your web app, this could be the root of your other issue, too.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i m using coustom control and user conrol in page asp.net page .this control added into ajax update panel control . i want to set runtime focus in custom control or user control in control. how to set focus? plz reply
lav naphade
|
|
|
|
|