Click here to Skip to main content
15,885,366 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to pass data from client to server in AJAX Pin
engsrini10-Jun-08 18:43
engsrini10-Jun-08 18:43 
Questionplugin / Addin framework for asp.net Pin
DarrollWalsh10-Jun-08 16:44
DarrollWalsh10-Jun-08 16:44 
QuestionSiteSearch does not work on server. Pin
Member 471549210-Jun-08 12:41
Member 471549210-Jun-08 12:41 
AnswerRe: SiteSearch does not work on server. Pin
Parwej Ahamad10-Jun-08 17:25
professionalParwej Ahamad10-Jun-08 17:25 
AnswerRe: SiteSearch does not work on server. Pin
eyeseetee10-Jun-08 21:31
eyeseetee10-Jun-08 21:31 
QuestionGridview Footer Totals = Subtotal - discount Pin
Sarfaraj Ahmed10-Jun-08 11:04
Sarfaraj Ahmed10-Jun-08 11:04 
AnswerRe: Gridview Footer Totals = Subtotal - discount Pin
Parwej Ahamad10-Jun-08 17:35
professionalParwej Ahamad10-Jun-08 17:35 
QuestionProblem Formatting a String inside a 3rd-party component [modified] Pin
Nostrom010-Jun-08 8:33
Nostrom010-Jun-08 8:33 
I'm using a 3rd-party component for a shopping cart (dotnetCART), and I am having a problem formatting a string. I know that since this is a 3rd-party control, you all may not be able to help, but I thought I's ask anyways...

The dotnetCART component has a web control called "Display Catalog" which displays products from the database. Although fields such as "Price" and "Weight" are included in the web control, my "WholePrice" field is not, and so I have to pull it in using the "GetCustom" property (or is it called a method?).

Right now the code in question looks like this:

<br />
< dotnetCART:DisplayCatalog ><br />
<br />
    ...some code...<br />
<br />
    < ItemDetailsTemplate><br />
        < asp:Label <br />
            ID="lblWholesalePrice" <br />
            runat="server"<br />
            Text='<%#Container.GetCustom("WholePrice") %>'><br />
        < /asp:Label><br />
    < /ItemDetailsTemplate><br />
< /dotnetCART:DisplayCatalog><br />

(FYI, a non-custom field would have been written into the label as "<%#Container.Price%>")

The above label works OK, but it displays the data without formatting, and so my "WholePrice" appears as "12.55" or "6.554", not "$6.55". I've read the asp.net information on formatting strings, and I have tried to apply a similar formatting syntax to the "Container.GetCustom" without success. I have tried:

<br />
Text='<%#Container.GetCustom(FormatCurrency("WholePrice")) %>'>

...returns an error from the component: "Conversion from string "WholePrice" to type 'Double' is not valid."

Text='<%#Container.GetCustom("WholePrice","{0:c}") %>'
...returns "BC30057: Too many arguments to 'Public Function GetCustom(strField As String) As String'."

Text='<%# DataBinder.Eval(Container.GetCustom, "WholePrice", "{0:c}")%> '>
...returns "BC30455: Argument not specified for parameter 'strField' of 'Public Function GetCustom(strField As String) As String'."

and

Text='<%# String.Format("{0:c}", Container.GetCustom("WholePrice")) %>'

... does not have any effect, but displays the unformatted "WholePrice".

Once again, I realize no one may be able to help in this case, but thank you for any advice or suggestions. The 3rd-party documentation seems a little fuzzy on this subject to my novice eyes, but the relevant passages appear to be as follows:

<quote>
Catalog Template Properties / Containers:
GetCustom("FieldName"): Used to show custom field data in the Templates. This returns any custom field data.

Programmatically changing a control value within a given page:
This is useful if you wish to change a control within the template programmatically, for example for language customization.

Label myTemp = (Label) Page.FindControl("Catalog:ItemDetails:myWeight");
if(myTemp != null);
myTemp.Text="Weight(Test):";

The "Catalog:ItemDetails:myWeight" is the ID for Weight label control used in default.aspx. The "Catalog" is the ID control in default.aspx page for Catalog control and "ItemDetails" is hardcoded ID inside the component for ItemDetailsTemplate Template. "myWeight" is the ID for label inside the ItemDetailsTemplate Template in default.aspx page

Thanks again.

EDIT: I just got some help with this.
Text='<%#FormatCurrency(Container.GetCustom("WholePrice")) %>
does the trick.

modified on Tuesday, June 10, 2008 3:28 PM

AnswerRe: Problem Formatting a String inside a 3rd-party component Pin
Parwej Ahamad10-Jun-08 17:31
professionalParwej Ahamad10-Jun-08 17:31 
QuestionAJAX: SimpleWebServices is not defined Pin
pankazmittal10-Jun-08 8:03
pankazmittal10-Jun-08 8:03 
AnswerRe: AJAX: SimpleWebServices is not defined Pin
Christian Graus10-Jun-08 8:23
protectorChristian Graus10-Jun-08 8:23 
GeneralSqlDataSource and Exceptions Pin
Brady Kelly10-Jun-08 7:56
Brady Kelly10-Jun-08 7:56 
GeneralRe: SqlDataSource and Exceptions Pin
Christian Graus10-Jun-08 8:24
protectorChristian Graus10-Jun-08 8:24 
QuestioniFrame and Focus Problem Pin
Archana New to Dotnet10-Jun-08 7:56
Archana New to Dotnet10-Jun-08 7:56 
AnswerRe: iFrame and Focus Problem Pin
Parwej Ahamad10-Jun-08 17:17
professionalParwej Ahamad10-Jun-08 17:17 
Questionwhat is urlrewriting in asp.net Pin
Rinki Mukheraji10-Jun-08 6:57
Rinki Mukheraji10-Jun-08 6:57 
AnswerRe: what is urlrewriting in asp.net Pin
Christian Graus10-Jun-08 7:02
protectorChristian Graus10-Jun-08 7:02 
QuestionSelecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row. Pin
Steve Holdorf10-Jun-08 4:31
Steve Holdorf10-Jun-08 4:31 
AnswerRe: Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row. Pin
Steve Holdorf10-Jun-08 4:46
Steve Holdorf10-Jun-08 4:46 
GeneralRe: Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row. [modified] Pin
Parwej Ahamad10-Jun-08 6:02
professionalParwej Ahamad10-Jun-08 6:02 
GeneralRe: Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row. Pin
Steve Holdorf10-Jun-08 6:45
Steve Holdorf10-Jun-08 6:45 
GeneralRe: Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row. Pin
Parwej Ahamad10-Jun-08 17:13
professionalParwej Ahamad10-Jun-08 17:13 
Questionhii please if anyone can help me would be great!!! Pin
Technobizz10-Jun-08 4:08
Technobizz10-Jun-08 4:08 
AnswerRe: hii please if anyone can help me would be great!!! Pin
Christian Graus10-Jun-08 4:13
protectorChristian Graus10-Jun-08 4:13 
Questionhow to convert text.table to text.pdftable in itextsharp? Pin
Ashish Kumar Vyas10-Jun-08 3:32
Ashish Kumar Vyas10-Jun-08 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.