Click here to Skip to main content
15,889,992 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: open project mvc Pin
Afzaal Ahmad Zeeshan28-Feb-15 3:24
professionalAfzaal Ahmad Zeeshan28-Feb-15 3:24 
Questionneed help to add paging in datalist access db with vb code Pin
Member 1148584027-Feb-15 8:46
Member 1148584027-Feb-15 8:46 
SuggestionRe: need help to add paging in datalist access db with vb code Pin
Richard Deeming27-Feb-15 10:31
mveRichard Deeming27-Feb-15 10:31 
Questionvb function / sub call using javascript . Pin
Member 815140727-Feb-15 8:13
Member 815140727-Feb-15 8:13 
AnswerRe: vb function / sub call using javascript . Pin
ZurdoDev27-Feb-15 9:35
professionalZurdoDev27-Feb-15 9:35 
Question"End of statement Expected" error Pin
samflex27-Feb-15 5:11
samflex27-Feb-15 5:11 
AnswerRe: "End of statement Expected" error Pin
PIEBALDconsult27-Feb-15 5:25
mvePIEBALDconsult27-Feb-15 5:25 
AnswerRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 6:28
mveRichard Deeming27-Feb-15 6:28 
You have a combination of incorrect quotes and a missing closing parenthesis.

Try something like this:
ASP.NET
<asp:TemplateField HeaderText="Select" SortExpression="siteid">
    <ItemTemplate>
        <asp:HyperLink ID="hdReserve" class="js_siteid"  AutoPostBack="false" runat="server" Text="Select"
            NavigateUrl='<%# String.Format("ReserveFacility.aspx?id={0}&groupsize={1}&facilityFees={2}&depoitAmt={3}&cancelAmt={4}&keydeptAmt={5}&extrahour={6}&hoursdiff={7}", CType(Container.DataItem, System.Data.DataRowView)("siteId") , ddlPartySize.SelectedValue, CType(Container.DataItem, System.Data.DataRowView)("RentalFeeAmount"), CType(Container.DataItem, System.Data.DataRowView)("DepositAmount"), CType(Container.DataItem, System.Data.DataRowView)("CancellationAmount"), CType(Container.DataItem, System.Data.DataRowView)("DepositAmount"), CType(Container.DataItem, System.Data.DataRowView)("ExtraHourAmount"), hourDiff) %>'
        />
    </ItemTemplate>
</asp:TemplateField>



If you're using .NET 4.5, you can simplify that code by using a strongly-typed data control[^]. Just add ItemType="System.Data.DataRowView" to your data-bound control, and then replace each instance of:
VB.NET
CType(Container.DataItem, System.Data.DataRowView)("...")

with:
VB.NET
Item("...")



If you're using an earlier version, you could still make the code easier to read by using Eval:
VB.NET
Eval("...")

However, that will perform very slightly slower - you'd need to run some performance tests on your code to see if the difference was a problem.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 6:40
samflex27-Feb-15 6:40 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 8:04
mveRichard Deeming27-Feb-15 8:04 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 9:03
samflex27-Feb-15 9:03 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming27-Feb-15 10:29
mveRichard Deeming27-Feb-15 10:29 
GeneralRe: "End of statement Expected" error Pin
samflex27-Feb-15 10:44
samflex27-Feb-15 10:44 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 1:43
mveRichard Deeming2-Mar-15 1:43 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 4:04
samflex2-Mar-15 4:04 
GeneralRe: "End of statement Expected" error Pin
Richard Deeming2-Mar-15 7:10
mveRichard Deeming2-Mar-15 7:10 
GeneralRe: "End of statement Expected" error Pin
samflex2-Mar-15 14:55
samflex2-Mar-15 14:55 
QuestionJSON Hijacking and ASP.Net MVC Pin
Tridip Bhattacharjee27-Feb-15 1:55
professionalTridip Bhattacharjee27-Feb-15 1:55 
AnswerRe: JSON Hijacking and ASP.Net MVC Pin
Richard MacCutchan27-Feb-15 3:00
mveRichard MacCutchan27-Feb-15 3:00 
QuestionWeb site various attack and security Pin
Tridip Bhattacharjee26-Feb-15 23:55
professionalTridip Bhattacharjee26-Feb-15 23:55 
AnswerRe: Web site various attack and security Pin
Richard Deeming27-Feb-15 1:26
mveRichard Deeming27-Feb-15 1:26 
QuestionRe: Access from data from Ms access Pin
Praveen Kandari26-Feb-15 1:16
Praveen Kandari26-Feb-15 1:16 
AnswerRe: Access from data from Ms access Pin
Richard MacCutchan26-Feb-15 2:00
mveRichard MacCutchan26-Feb-15 2:00 
GeneralRe: Access from data from Ms access Pin
Praveen Kandari26-Feb-15 17:04
Praveen Kandari26-Feb-15 17:04 
Questionaccess data from ms access with date Pin
Praveen Kandari26-Feb-15 1:13
Praveen Kandari26-Feb-15 1:13 

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.