|
Please helppppppppppppppppppppp
|
|
|
|
|
I have applied this format {0:c} which shows a negative number like this ($23.43)....i want to show negative numbers in square brackets. How to achieve that?
|
|
|
|
|
Civic06 wrote: .i want to show negative numbers in square brackets.
It's not the *standard* way to show negative numbers. using round brackets '()' is the standard way to show negative number and thus the implementation.
If you want to show it in square bracket '[]' then you need to write your own custom formatter. You cannot change this in existing format rules.
|
|
|
|
|
Hi All,
I have a Rad ListBox, and a button for save, when user check or unchecks any item in the list box. The save button should be enabled. Other wise it is disabled. Can anybody help me in doing this either using Java script or Code behind. Anything is ok.
Any link or any code snippet is very much helpfull.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
on page load you may try like
saveBtn.Enabled=false;
Build a javascript function such that it gets enabled when a user clicked on the listbox.
like
document.form1.getElement("mylistbox1").checked
document.form1.getElement("saveBtn").enabled=true;
|
|
|
|
|
I am wondering if any one of have experience a url that contains a folder name with an "&" or amperand sign in it and getting the "Bad Request" message through an IE.
I have a folder name like A&R. I have even tried encoding the url but there was no success. I know amperand is an especial character in a url but is there any solution to this problem in iis7.0?
kindly let me know thanks in advance.
|
|
|
|
|
When you say you are encoding them, is that a UrlEncode? Are they converting to %26?
|
|
|
|
|
yes, that's right it convert to %26 but path couldn't be accessed
such as ../../A&R/data.txt
|
|
|
|
|
netJP12L wrote: yes, that's right it convert to %26 but path couldn't be accessed
such as ../../A&R/data.txt
If URL is encoded correctly then it should look like ../../A%26R/data.txt
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I have a inventory application that pulls data from our database.
So on a page called loggedin.aspx I have two drop down list on the left and a DATALIST (with a pageddatasource) on the right. Now the two boxes on the left let you choose the CITY and the YEAR for the inventory.
Once you select both drop a drop down and click GO it sets the session variables:
protected void btnGo_Click(object sender, ImageClickEventArgs e)
{
if (ddlJUR.SelectedIndex != -1)
Session["JUR"] = ddlJUR.Items[ddlJUR.SelectedIndex].Text;
if (ddlFY.SelectedIndex != -1)
Session["FY"] = ddlFY.Items[ddlFY.SelectedIndex].Text;
}
Now on page load it should be pulling data from the database based on those values. It should also be setting a label stating which values you ahve chosen and also selecting the correct jurisdiction/ fiscal year from the drop down box:
protected object FY;
protected object JUR;
FY = Session["FY"];
JUR = Session["JUR"];
if (JUR == null)
lbBreadCrumb.Text = "Please select the jurisdiction from the left.";
else if (FY == null)
{
ListItem iJUR = ddlJUR.Items.FindByText(JUR.ToString());
if (iJUR != null)
ddlJUR.SelectedIndex = ddlJUR.Items.IndexOf(iJUR);
lbBreadCrumb.Text = JUR.ToString() + " > " + "-Please select the Fiscal Year from the left-";
}
else
{
lbBreadCrumb.Text = JUR.ToString() + " > " + FY.ToString();
ListItem iJUR = ddlJUR.Items.FindByText(JUR.ToString());
if (iJUR != null)
ddlJUR.SelectedIndex = ddlJUR.Items.IndexOf(iJUR);
ListItem iFY = ddlFY.Items.FindByText(FY.ToString());
if (iFY != null)
ddlFY.SelectedIndex = ddlFY.Items.IndexOf(iFY);
if (!IsPostBack)
{
BindData();
}
}
It doesn't seem to work though. You have to click the go button twice. Iti s like the session variable doesnt set before the postback happens and the page is loaded??
|
|
|
|
|
Load happens before click. You click code will have to do some work to get the expected results. Ie, your code in page load needs to be in a place where your click can call it too.
|
|
|
|
|
Ahhh... ok...
Well for what I am tryign to do is Session the best result? I don't know much about ViewState but I'm reading more on it. Is there something else I should be doing?
|
|
|
|
|
Uhm I thought I knew what you meant but I guess not. Do yuo happen to have an example on a situation like this? I pretty much have to get those session variables on page load so I can query the database and show the data. But then they must also need to be able to change that information from the drop down list
|
|
|
|
|
You can never get the data on page load the first time around if this is the same page where the data is assigned. Try this some combination of the below:
protected void mBtnAssignWhatever_Click(object sender, EventArgs e){
...Assign Session Variables
PopulateForm();
}
protected void PageLoad(...){
LoadDataFromDatabase();
if(!IsPostBack){
}
PopulateForm();
}
private void PopulateForm(){
if(AreMySessionVariablesAvaiable()){
...
}
else{
...
}
}
|
|
|
|
|
Ok I see where you are going with this.
I may not be able to do what I need. Because I need to load the data from the database BASED on the session variables. ("SELECT * FROM Blah WHERE FY=<session variable=""> AND JUR=<session variable="">").
Your example above loads from the database first. I would think of pulling all the data and then filtering based on the session variables but that is a TON of data to pull.
Can you think of anything other than session variables to use? I was using QueryStrings but didn't really want to go back to that. I might have to though.
|
|
|
|
|
Try the following in your Data load event:
if(SessionDataIsLoaded()){
LoadData(sessionValue, ...);
}
else{
LoadData(defaultValue, ...);
}
|
|
|
|
|
Are you talking about the datalist Init event? Because I do not even begin to call anything that pulls data without having the session variables first.
|
|
|
|
|
|
So...I have decided to use PayPal. To my surprise, there is apparently no smooth way to use a PayPal form button on an ASP.net page. OK....so I create a HTML page with the button on it and I insert it into the website. When the user hits Submit from ASP.Net, it enters all the data into the database and then brings up the HTML page with the button....and that works fine. However, I want to post the generated Customer ID number for the customer so that when he returns to the site with proof of purchase from PayPal, I can identify him in the database. What I need to do is have the ID, which was generated by a script on the ASP.Net page, pass that information to the HTML page into a label along side the PayPal button so the customer can write it down and use it with his proof of purchase (invoice) from PayPal. If I was using ASP to ASP, I would simply create a Session value and that would be the end of it. But how do I get the value from the ASP page to the HTML page? Any insight or an example would be greatly appreciated. Thank you, Pat
ps: I may have accidentally posted this into another place on this site. It was not an INTENTIONAL double entry. For those purists that cannot deal with a simple mistake, I apologize in advance and hope that the extra entry doesn't ruin their day.
|
|
|
|
|
Why did you create an HTML page instead of an ASP.NET page? ASP.NET now supports multiple form tags in a page (kinda) which will allow you to use ASP.NET to populate your form as you are familiar and then post to the PayPal site.
|
|
|
|
|
Did you try a google search for paypal asp.net? While there are 2.3 million results to sort through, several on the first page looked very promising.
|
|
|
|
|
Thank you, Mr. Gray and Mr. Lynch. I am sure that since the article I read was written, there is some kind of ASP.Net solution. I like ASP.Net and prefer it, but as a developer, the first think I learned is not to swim against the tide. I think PayPal is foolish for not creating a streamlined solution for this issue, however, that's their deal. Mine is to make it work as simply and effectively as possible. I therefore have decided to use a simpler integrated solution that uses both ASP and HTML pages. For others looking in, I use ASP first to get the data into the database, then use it again to show the customer the information I need him to have. Then, I go to HTML to host the PayPal button, which was written for HTML. It looks good (enough) and works perfectly, which is most important, so I am going to stay with it, at least for now. I appreciate the input from both of you. Thank you and best regards, Pat
|
|
|
|
|
Hi,
My website shows a sessiontimeout page when some event happens on a page and the the sesssion is expired.
All Page inherits from sessionmanagement class
In the init function of sessionmanagement class, in case the session is expired, it redirects page to sessiontimeout.htm which is in the same folder as response.redirect("sessiontimeout.htm")
For main.aspx it works fine, shows sessiontimeout.htm fine.
main.aspx has ajaxtabcontainer and each tab has iframe.
The pages in the iframe are also inherited from sessionmanagement class.
In case session expires and any event happens in the pages in the iframe, it tries to load sessiontimeout.htm but gives error -400.
I checked the properties in browser. To my surprise, it was trying to load as
<base url="" />/<base root="" folder="" again="" />/sessiontimeout.htm
e.g. if my baseurl is http://myserver/mysite it was trying to load as http://myserver/mysite/mysite/sessiontimeout.htm
I dont know why it was appending the base root folder again.
Why it is giving this strange behaviour from pages in iframe when all the pages are in the same folder?
I guess for this application, this was not happening in visual studio 2008 but now I am using visual studio 2010.
Any suggestions?
Thanks
Vijay
|
|
|
|
|
|
I have a masterpage called CaseManagement.Master and a content page called AppointmentSchedule. On my master page I have a textbox called txtPolicyNumber. How do I access this textbox from the content page's codebehind? "this.txtPolicyNumber" and "this.Master.txtPolicyNumber" doesn't work.
|
|
|
|