|
I am running into a little bit of trouble here. Basically, I launch a popup from a form
Step 1: Form ("Employee Detail", for example)
Step 2: From "Employee Detail" form, I launch a modal dialog
<br />
function ShowSelectCostCenterDialog() {<br />
var ret = false;<br />
<br />
ret = window.showModalDialog('../UserControls/SelectCostCenterFrame.aspx?MoreThanOneBU=true', window, 'dialogWidth:970px;dialogHeight:490px;resizable:yes;scroll:yes;status:no;');<br />
if(ret) {<br />
document.forms[0].submit(); Post-back did occur. Page_Load was run and I verified it with debugger.<br />
} else {<br />
}<br />
return;<br />
}
I opened debugger, Page_Load did occur and "cost center" was retrieved from Session[COST_CENTER] and during Page_Load:
txt_CostCenter.Text = cost_center; (This was indeed executed during Page_Load)
I checked and verified that, immediately before "return" in Page_Load, txt_CostCenter.Text was indeed updated. However, the "rendered" page as seen in browser didn't get updated accordingly!?
Any idea guys?
Norman Fung
|
|
|
|
|
Hi Norman,
+ Is there any chance that the textbox is overwritten somewhere else before the page is rendered?
+ IMHO, you may just simply use the returnValue to return the cost-center value instead of posting the page back to update the textbox.
|
|
|
|
|
Hi minhpc, long time no see... How'ya doing?
minhpc_bk wrote: + Is there any chance that the textbox is overwritten somewhere else before the page is rendered?
Well, I stepped through the code: from the moment txt_CostCenter was updated (as intended) to last line in Page_Load... I don't see any other event handler on the page... And don't think "txt_CostCenter" will be overwritten by anything from base page...
minhpc_bk wrote: + IMHO, you may just simply use the returnValue to return the cost-center value instead of posting the page back to update the textbox.
Just being lazy...
Norman Fung
|
|
|
|
|
Thanks Norman, it's quite long not to see you around .
norm wrote: Well, I stepped through the code: from the moment txt_CostCenter was updated (as intended) to last line in Page_Load... I don't see any other event handler on the page... And don't think "txt_CostCenter" will be overwritten by anything from base page...
Do you use any data binding expression with the TextBox? May I see your sample code? You can also try with simple code to make sure that it's working in the way you want.
|
|
|
|
|
Hi
Is there any drawbacks in using SQL server 2000 as the back end for ASP.net 2.0 application. Is there any chance for some functionalities wont work.
|
|
|
|
|
Only if your application uses those SQL features which are not supported in MS SQL 2000 (e.g. you're using Oracle PL/SQL).
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
Hi ol..
I am having a situation to push data to connected desktop clients. the scenario is that a search criteria would come from a web browser and depending on the criteria the message has to be multicasted to connected desktop clients. The web application is partly developed in ASP.NET 2.0 but im still loking for best ways to push this data to desktop clients. I was wondering if i could use a web service approach(but again the data cannot be pushed but only requested) or sockets. wat would the firewall or IP address issues in case of Sockets??
I am looking for any help or suggestion which could guide me towards developing this kind of framework.
any related articles also plese..
|
|
|
|
|
To push data from the server side to the client side, you may consider a couple of options below:
+ Use the .Net remoting, and you may have a look at the GenuineChannels[^] that does all the hard part for you.
+ Use the SQL Notification Services.
Just some ideas.
|
|
|
|
|
Thanks a lot for that min...U seem to be solvoing a lot of problems in this forum so im sure u can help me. I was wondering if i could use sockets to push data from server to client (like a messenger or chat application). here i have 3 questions:
1) is it possible to have a chat like application from web browser to desktop apps which are spread accross internet??
2) In case of sockets, is there constant polling to keep the connection alive? this question is just to know the total data transfer which happens in the application.
3) How can we determine the details of currently connected clients??
please consider this help request..
|
|
|
|
|
From my experience with GenuineChannels, the library does all what you mentioned in your 3 questions. Actually, GeuineChannels uses the socket internally and there are lots of interesting things in there which saved me much of my effort instead of doing socket programming on my own. You can also take a look at one of the socket libraries posted here which might give you a couple of ideas on how to do this:
http://www.codeproject.com/cs/internet/AsyncSocketServerandClien.asp[^]
|
|
|
|
|
Thanks again min..I have gone thru both the links. Genuinechannels is great but i don think i can use it for a university project and moreover it is a purchase product. So should i go ahead with reading for socket programming??
I am thinking of having a listener(server) component with every desktop client. Any request from web browser which needs to be passed to these desktop clients can fetch the listner(server) details from the application cache (list of active listeners). Is this approach feasible??
|
|
|
|
|
mastjabs wrote: i don think i can use it for a university project and moreover it is a purchase product. So should i go ahead with reading for socket programming??
Ah you are doing a university project, but I'm not sure if it's possible that you can use an evaluation version of the library in the project. But if you take this project for learning, my humble adivice is to dig into socket programming at low level or a high level technology such as .Net Remoting, and you can learn lots of cool things.
mastjabs wrote: I am thinking of having a listener(server) component with every desktop client. Any request from web browser which needs to be passed to these desktop clients can fetch the listner(server) details from the application cache (list of active listeners). Is this approach feasible??
Well, IMO the system might be working in the manner that the request is sent from web browser to the server which in turn is responsible for routing the request to the list of active listeners.
Also, this is the forum for the ASP.NET, so I don't think it will help you much in the field. In this case, you might want to visit the C# or VB.NET forums to look for better help whener you hit the wall .
|
|
|
|
|
Hello,
I am hosting my website with LunarPages who dont allow remote connection of SQL server. But I have developed my websites using local instance of SQL Express and kept mdf files in APP_DATA folder. So, I wanted a tool which can synchronize my local sql express mdf file with remote sql server. As SQL manager type software could do this things but they need to connect my remote sql server which is not allowed. I wanted to make a software by myself who can read a local .mdf file and generate SQL script (i.e. CREATE TABLE, INSERT INTO ) etc and communicate with an ASP.NET page and ASP.NET page will synchronize the SQL server database by executing the SQL query (CREATE TABLE....). Now Can you tell me which software or library can help me to generate sql create table / insert statements from local MDF file and at how can I read the SQL server database and get SQL statement again to build an mdf database in my local pc. In that way I can develop ASP.NET web application in my local pc with local mdf file with peace of mind. And at the same time if i can convert my remot sql server database to mdf file that will be a nie back up system for me.
Thanks
EMRAN
|
|
|
|
|
Hi
I am dynamically populating a TreeView using the method:
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
}
but the problem is: e.Node.Parent is *ALWAYS* null even if I click on leaf and non root nodes! any idea why?? The ValuePath string is correct and the Depth property is also always correct but Parent will always be NULL! this has me totally stumped.
any ideas? I wasted like 2-3 hrs debugging other code for this but then finally found this to be the case and am using the ValuePath to determine the root node now
(please reply here, do not send me an email thanks)
|
|
|
|
|
If you populate the nodes from client without posting the web page back to the server, then the e.Node.Parent is null as the e.Node simply represents the current node to be processed and it is not in the TreeView's nodes collection at the server side. If you want it to be not null, you can set the SelectAction property to SelectExpand . Another option is to keep the SelectAction with the Expand value, you can simply create an empty OnTreeNodeExpanded event handler.
|
|
|
|
|
Hi i a have managed to dynamically create and fill several checkboxlists on an asp.net page but now when i try and access whether or not they have been check i cannot manage to find any of the dynamically created controls on the page. i used the idea behind this tutorial here
http://www.codeproject.com/useritems/DynamicServerControls.asp[^]
so im just wonderin if anyone has any ideas why i cant access the new controls on the page i have tried each of these ways to access them, thanks in advance,
Tim
private void createFile_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
int trackControlID = 0;
if (PHOptions.FindControl("checkBoxList"+(trackControlID).ToString()) == null )
{
Label1.Text = "FOUND 1";
}
if (PHOptions.FindControl("checkBoxList"+(trackControlID)) != null )
{
Label2.Text = "FOUND 2";
}
//*** declare somecontrol point to found control
System.Web.UI.Control c = FindControl("checkBoxList"+trackControlID.ToString());
//*** change control to be DropDownList
CheckBoxList cbl = c as CheckBoxList;
if (cbl!= null)
{
Label3.Text = "FOUND 3";
}
string boxName = "checkBoxList" + (trackControlID+1).ToString();
CheckBoxList tb = PHOptions.FindControl(boxName) as CheckBoxList;
if(tb != null)
{
Label3.Text = "FOUND 4";
}
int i = 0;
}
|
|
|
|
|
Dear All,
Recently i noticed a problem .Simply the problem is i two text boxes for regno and Name and a button to save . I wrote code for saving data in button Click event. That works fine. Once i saved a data and then refresh the page the data is again saving. that means when refreshing the page button click event also executing. This creats many problem in our project. so many double entries occured. How can avoid it.?
(one solution is check same data is present in the database before inserting. But this is not practicably apply for my cases)
Please help me..........
Urgent
(if u didn't understand our problem please contact me meetbinu2003@gmail.com)
|
|
|
|
|
Just give Response.Redirect to the same page soon after the Insert.
This problem is there for deletes also, so it is a good practice to give response.Redirect soon after the opertion, so that the viewstate is cleared.
|
|
|
|
|
Is there any wat to user web.sitemap to set my pagetitle <title>My Title.
Title in each node is used for MenuText ... Sooo ... Anyone knows how about Page Title?
Regards / h
|
|
|
|
|
Google is your friend! Scott Mitchell has an article[^] over at 4GuysFromRolla explaining how to accomplish this.
Hope that helps.
--Jesse
|
|
|
|
|
=))
I found it =)
I reasd that article once before but know I saw it.
Thanks =)
//h
-- modified at 12:04 Monday 3rd July, 2006
|
|
|
|
|
Hi friends,
I suddenly stuck up today will any one help me out. The problem is like this.
I have a site in asp.net where to view pages login is required. I've used form authentication to solve this problem. Now after these pages are called they have links to pdf documents. these pdf documents are visible only if the user is a subscriber to this document.But once the URL is known, any body can know the directly access the pdf documents. Can it be possible with form authentication so that whenever the URL path to the pdf document is entered directly, the user is redirected to Login page.Also how could we distinguish that this user is a subscribed user or guest user and which of document he is allowed to see.
Thank You
Warm Regards:-
Tech4U
|
|
|
|
|
You may want to consider creating an HTTP handler for the PDF requests.
Instead of linking directly to the PDF, you would link to your HTTP handler, passing a document identifier in the query string. The handler would be responsible for handling user security and retrieving the PDF on the user's behalf. Sending the PDF via an HTTP handler would look something like:
using System;
using System.Web;
namespace Example
{
public class PDFServer : IHttpHandler
{
///
/// Signals whether the instance of the HttpHandler is reusable
/// accross requests.
///
///
/// <value>True if the instance is reusable, False otherwise
///
public bool IsReusable
{
get
{
return true;
}
} // End property IsReusable
///
/// Performs the needed processing and rendering for an Http Request.
///
///
/// <param name="context" />The Http contect for the request
///
public void ProcessRequest(HttpContext context)
{
// Grab the document id from the query string and use it to determine
// the document name and the path.
string docId = context.Request.Params["docId"];
string docName = DetermineDocumentName(docId);
string path = DetermineDocumentPath(docId);
// Set the response header to suggest a default file name.
context.Response.AppendHeader(String.Format("content-disposition","attachment; filename={0}", docName));
// Set the appropriate MIME type for a PDF file.
context.Response.ContentType = "application/pdf";
// Read the file directly to the response stream, then end the response.
context.Response.WriteFile(path);
context.Response.End();
} // End method ProcessRequest
} // End class PDFServer
} // End namespace Example
You can find plenty of information on creating HTTP handlers on the web. I'd
recommend looking at:
- Microsoft's How To Create an ASP.NET HTTP Handler by Using Visual C# .NET,
here[^]
- Michael Flanakin's blog entry[^] on the topic
Hope that helps.
--Jesse
|
|
|
|
|
Thank u Jesse.
I proceded as u have guided and the outcome is good, but now my program only distinguishes between authenticated user and anonymous users. I need a method from which I can know whether the said user is a subscriber to that document or not.
Now suppose a situation can be created like this:-
A person X has subscribed a document "abc.doc" now X is able to see the document and also can see the full URL. Now if he copy the url and give it to other person Y. Then Y can do these steps to see the document
1)Login
2)paste the url given by X
Then he will be able to see the document, even if Y is not a subscriber to that document.
Please help to rectify this.
Thank U.
|
|
|
|
|
Hi,
I want to maintain the viewstate when i go from one Page to another.For eg: I have a Page with textboxs and Datagrid. When there is data in the first Page and when i go to another Page and come back , i want to see the data in the first Page. How to do? I have enabled Viewstate in the Page and for all controls, even then the data disappears.
|
|
|
|