Asp.net - @Model Not Supported In Razor Views For VB?

Feb 27, 2011

Is not the @Model MyModelClass notation not supported in VB Razor Views? It's not working for me. What is the construct for it?

View 1 Replies


ADVERTISEMENT

Error Message: "This Server Version Is Not Supported Only Servers Up To Microsoft SQL 2005 Are Supported"

Nov 6, 2009

Error Message: "This server version is not supported. Only servers up to Microsoft SQL 2005 are supported VB.NET" I am using VB.NET 2008 and attempting to connect to SQL Server 2008 with XP as the operating system. I have service pack 1 installed in Visual Studio but this error message presists. The articles I have read on this error said to install sp1 as a solution but I have done that and the error persists. FYI, the error does not occur when I am using code to connect to SQL Server but when I attempt to connect using one of the designer wizards this error occure.

View 3 Replies

SQL Views And VB2008Express?

Sep 4, 2009

After creating a multi-table SQL View in a dataset and trying to configure it, the vizard refuses to create UPDATE, INSERT, DELETE statements or Update method. Does that mean that Views altered by VB code cannot be written back into the database? I am having trouble finding good basic information about SQL Views handled from VB.

View 2 Replies

Asp.net - Converting C# Razor To VB?

Feb 28, 2011

I'm following the ASP.NET MVC Tutorial and having started in VB.NET I'm having trouble converting the following razor code:

[code]...

on both the <li> tags. I understand I need to use line continuation but can't figure out where. I'd be greatful if you can point out the problem.

View 3 Replies

.net - Different 'views' In A Single WPF Window?

Oct 11, 2010

I'm doing a VB.Net subject at university and the major assignment is the creation of a WPF application.The application is management-focused (adding, modifying, deleting entries, etc). As these are all rather disparate tasks I'm thinking to create a tabbed interface for my assignment (in a similar vein to [URL]...

I'm a bit confused as to how I should go around approaching this? Btw, would this classify as MDI?We were recommended to create a menu system that listed all the options - upon selecting an option, a new window would be opened, the interaction would take place. If the user wanted to do something else, he'll close the window to be taken back to the menu screen.

This doesn't really seem like an elegant approach to me and it seems like it'll be an interesting exercise to implement the tab-based system I explained.I'd appreciate if anyone could point me in the right directions or give any hints as to how I should achieve. Is it possible, for example, to create each option in a separate xaml/code-behind file and then 'plug' these into each tab?edit: To clarify, let's take a hypothetical of an indoor soccer team management system. Let's say there are five different tasks the user can perform: 'Register a player', 'Modify players', 'Register a team', 'Modify team details', 'Add player to team'.

Each task is separate from the next. One way of creating the application is to create a main page with a button for each task. When a user click on each button, a new window opens up (for example, if the user clicks 'Register a player', a new PlayerRegistration window is opened).

What I'm looking for, as mentioned above, is a tab-based approach. In my application, if the user clicks 'Register a player' the entire PlayerRegistration xaml file gets loaded in a segment of the window. The same happens when the user clicks any other button.

View 2 Replies

DB/Reporting :: Get Query Of Views In .net?

May 22, 2008

anyone knows how to fetch the query of a view (Sql server) in vb.net?

View 3 Replies

Asp.net Mvc 3 - Translating The Razor Syntax?

Jan 25, 2011

MVC 3 is great but in some cases I am having trouble translating the Razor syntax. Anyone know of a good VB.Net Razor reference?

View 1 Replies

Asp.net Mvc Razor For Loop Syntax

Apr 5, 2012

Trying to create VB.net equivalent for following code and I get error

<ul>
@for (int i=0; i < ViewBag.NumTimes; i++) {
<li>@ViewBag.Message</li>
}
</ul>

View 2 Replies

HtmlAttributes On ASP.NET MVC 3 With Razor View?

Apr 7, 2011

how do I add this htmlAttribute on MVC 3 Razor view?

New With {.watermark = "sometext", .title = "sometext"}

I tried the C# way but it's not working (@watermark) but it's not working.

UPDATE here is the current usage I am trying but it's not working.

@Html.EditorFor(Function(model) model.FirstName, New With {.maxlength = "50"})

This isn't working either

@Html.EditorFor(Function(model) model.FirstName, New Object() {"maxlength=50"})

View 3 Replies

What Is The .NET Equivalent Of This C# Razor Syntax

Nov 29, 2011

In the MVC 3 book by Steven Sanderson on p185 at the bottom, the following expression is used to render the paging links.

@Html.PageLinks(Model.Paginginfo, x=> Url.Action("List", new {page = x}))

What is the VB.NET equivalent? I am stuck on the x url lambda bit.

View 1 Replies

Compare Rows Of Two Grid Views GW1 And GW2

Mar 30, 2009

I want to compare rows of two grid views.GW1 and GW2.When I click a Search Button ,I want to check the Values in the GW2,and if GW1 and GW2 have same PayID ,EmpID,then that specific row of GW1 must be disabled.

View 3 Replies

Property Pages And Multiple Views

Mar 31, 2009

I've been wondering what a good solution is for displaying multiple forms all within the same form. I am fairly new to .net, so I might be asking a typical newbie question here, but I was wondering how one deals with having to show many forms all in one parent form. For example, I have a signup form where there is a Next button that shows, say, up to 10 'pages'. In VB6, I simply made a collection of pictureboxes as containers. At runtime, I'd set each picturebox on top of the other then set the requested picturebox's zorder to 0 when it was needed to be shown. Many pictureboxes became a bit obtrusive taking up most of the visual area of the form in design mode so I then started putting them in a tabstrip control then making the tabstrip very tiny and out-of-the-way and then setting it's visible property to false so that it wouldn't be seen at runtime. On the form's load event, I'd simply parent all of the pictureboxes (usint SetParent) to the main form and then use the zorder teqnique as usual. Lame, I know.In VB.net, I've tried just making many forms and then parenting them when needed, but I get an error that a top-level control can't be parented/added to another top-level control. I haven't tried the SetParent API technique yet because I'm sure that there is a common, simpler solution that you experts use.

View 4 Replies

Wpf - Multiple Views Of Observable Collection?

Mar 13, 2012

I've been working on this problem for a while and I'm clearly missing something...I create, populate and bind an observable collection like so:

Dim _ObservableWEI As New ObservableWEI
...
_ObservableWEI.Add(New WEI() With {.WEInum = 1, .WEIvalue = 1})[code].....

The problem is the filter effects the contents of both listboxes. I guess I need a specific instance of the collection to apply the filter too or something

View 1 Replies

.net - Concatenate Tag Attribute Value Using Razor And A Prefix

Jun 16, 2011

How do I do this in Razor (VB.NET):

[Code]....

View 1 Replies

Access My.Resources From A Razor View?

Jul 6, 2011

I have a razor.vbhtml view and would like to use string resources normally accessible via My.Resources. Seems like I can only get to My.Computer, My.Log and couple other namespaces from the view, but not My.Resources. I've tried changing access modifier to public and adding Imports, neither worked.

View 1 Replies

Asp.net - Html.CheckBoxFor In VB Razor View?

Feb 27, 2011

I have this C# code in a Razor view:

@(Html.CheckBoxFor<RazorSamplesWeb.Models.SamplesModel>(i => i.IsActive))

I tried translating it to this:

@Code Html.CheckBoxFor(Of RazorSamplesWeb.Models.SamplesModel)(Function(i) i.IsActive)End Code

But it's complaining.

View 3 Replies

Asp.net Mvc - Razor View Engine Quirks ?

Nov 12, 2010

I just downloaded the MVC 3.0 RC and I'm excited to start using it, especially the Razor view engine. However, due to a few stick in the mud type people here, we are stuck using VB.NET instead of C#.When I started trying it out, I noticed some quirks. If you are creating a Razor view using CSHTML, you can write code like this:

@foreach(string genreName in Model.Genres)
{
<li>@genreName</li>
}

Razor will automatically detect that the <li> text is an HTML tag and will switch out of "code mode". With a VB.NET VBHTML file, this doesn't seem to be working. It's making me put the @: keyword in front of each line like this:

@For Each genreName As String In Model.Genres
@:<li>@genreName</li>
Next

If I don't have it there, I get a runtime error. Also, the <text></text> tags don't seem to work.

View 3 Replies

Converting C# Razor View Syntax?

Mar 21, 2012

I am new to Razor view syntax and as most of the examples are in C# in coverting the below Razor syntax to vb.net

<div>
@using (Html.BeginForm())
{

[code].....

View 1 Replies

Mvc - MVC3 Razor SelectedValue In DropdownListFor?

May 30, 2012

I've the following code for a DropDownListFor and is working ok

@Html.DropDownListFor(Function(model) model.Habilitacoes, New SelectList(ViewBag.Habilitacoes, "KeyHL", "DescricaoHL"), New With {.class = "FillHSpace"})

[code].....

View 2 Replies

VB - ASP MVC 3 Razor Extra Whitespace Rendered

Jul 8, 2011

I am getting extra whitespace characters rendered in my horizontal list of anchor tags below. This is causing a major CSS styling issue for me. I know this question has been addressed as far as a C# workaround is concerned (asp.net mvc razor extra space), but can anyone help me with a VB workaround? I don't have the advantage of curly braces to eliminate all whitespace in a single-line If condition.

I have managed to work around it for now by writing an HtmlHelper extension method, but this dynamic code is only used in one place (the master layout page). It seems to me that this should really be done in the .vbhtml page. Here is the erroneous code, along with commented-out attempts at workarounds. The goal is to create a horizontal list of "sibling" pages based on a site map, with slightly different styles for the current page's link and the link just before it. [Code]

View 1 Replies

What's Razor Syntax To Create A Table

Mar 15, 2012

This should not be as hard as it seems to be, but I can't for the life of me create a table in VB using Razor syntax. The following does not work (despite what some examples would lead me to believe):[code]

View 2 Replies

ASP.NET MVC: Tracking Page Views And View Duration?

Jul 26, 2010

I have an application I'm currently working on that requires Administrators to be able to track the views of a ticket and it's duration.I've got the tracking of the number of views by users sorted out, I have a table that contains a TicketID, UserID and a DateOpened. Each time a user visits the page, a new row will be inserted.However, the way I would like to track the duration of views is by having a DateClosed field in the table which will allow me to work out view duration in the code as opposed to storing the time directly.

I can't use Google Analytics or anything Third Party for the task either due to internal policy as it's an intranet application.What would be the best way to achieve filling this field on page exit?

View 1 Replies

ListView Capable Of Displaying Files In All Available Views?

Mar 13, 2009

I have a ListView capable of displaying files in all available views (Large Icon, Small Icon, Tile, List, Details). Now I am wondering how to properly use the SmallImagelist and LargeImagelist for the small and large icons...the ListView is actually a modified listview (inheriting from ListView), using a modified ListViewItemCollection.In this custom ListViewItemCollection I use the Add override function to add a few details to my ListViewItem:

vb.net Public Overrides Function Add(ByVal value As System.Windows.Forms.ListViewItem) As System.Windows.Forms.ListViewItem
Dim file As clsTexture = TryCast(value, clsTexture)
If file IsNot Nothing Then

[Code]...

I realize it is a pretty complex post to read and will probably not get very many answers, but I really want to make the most of my Listviews...Of course, one work around is to just always use the LargeIcon which then gets scaled down automatically when the SmallImagelist is used but I am pretty sure there are icons that are very different in Large or Small view...

View 3 Replies

Rendering Strongly Typed Partial Views

Sep 2, 2009

When ASP .NET hits the RenderPartial("Openings") line, an exception is thrown ("Could not load type 'System.Web.Mvc.ViewUserControl(of IEnumerable(of OpenSpace))'.") even though the view exists and the proper model is being passed in. The views are all inside the View folder and in this case, they're even in the same subdirectory.[code]

View 2 Replies

Using LINQ To SQL With Views Need To Cast / Convert To Table

Jun 25, 2012

My SQL Server database contains several views which are essentially filtered (WHERE) / ordered (ORDER BY) versions of some of the tables i.e. no joins.

An example would be my Downloads table, which has a view such as DownloadsOnlineOnly e.g.

SELECT * FROM Downloads WHERE Live = 1 ORDER BY FolderName ASC;

I can drag and drop these views onto my LINQ to SQL DataContext, and use LINQ to query these views and retrieve data fine...

But the foreign key relationships are not being picked up in my DataContext, so I've lost the ability to:

Dim dl as DownloadOnlineOnly = (From r in db.DownloadOnlineOnlies Select r).First

Dim fol as Folder = dl.Folder ' Syntax error as there is no association between

' DownloadOnlineOnly and Folder in my DataContext.

I understand why this is happening, but how can I get around this:

Without manually adding associations in my DataContext? Can I change the type of the Entity like changing the return type of an SP on the DataContext? Can I cast or convert between a DownloadOnlineOnly object and Download object? Or some other method?

View 1 Replies

[2008] Collecting Sub Items In List Views?

Mar 12, 2009

I have used list views for a project. I have used sum items on the items. The sub items are prices of products. I will need to use these sub items to come up with a total.Also, i have used to listviews, for a smoother look and feel. You click the product which then is removed from the list view and added to the second one. Would this also "move" the sub item across to the other list view?

View 1 Replies

Asp.net - Razor Inline Template Item Keyword In VB?

Feb 27, 2011

Check out this code sample from Scott Guthrie's blog: [URL]...Notice item is a reference to the currently executing item in C#, what is the equivalent keyword in VB.NET?

EDIT: I should add here is my actual implementation of a method accepting a template:

Public Function RenderInlineTemplate(ByVal template As Func(Of RazorSamplesWeb.Models.SamplesModel, Object)) As IHtmlString Return New HtmlString("<div style='display:inline;'>" + template(Model) + "</div>")
End Function And I get this error: Compiler Error Message: BC30201: Expression expected.

[Code]...

View 2 Replies

Asp.net Mvc 3 - .Net, MVC3, And Razor - Modifying ActionLink Helper?

Jun 21, 2011

How do I modify or create my own Html.ActionLink helper to accept and handle the first parameter (linkText) passed in as an empty string / nothing?Details: I currently have a strongly typed view that's passed a model which contains search results. My view loops through each item in the model and attempts to display a link to a contact with the following code:

@Html.ActionLink(currentItem.ContactName, "contact", "details", New With { .id = currentItem.ContactID }, Nothing)

Normally this would work just fine, but not every item in my search result has a ContactName. The Html.ActionLink helper errors when this first parameter is empty. In case it helps, here's the model property for ContactName (which is generated from a template due to Database First, so I don't believe it can be modified):

Public Property ContactName As String

I'd like to have a helper function that simply returns nothing if the ContactName is an empty string / nothing.I'm guessing I need to extend this helper, and I've struggled to find any good, up-to-date resources in VB.net for extending helper functions. Other approaches are more than welcome if they're considered best practice. I'm working in VB.net, MVC3, and Razor in the ASP.net 4.0 framework.

View 2 Replies

Namespace Reference In .NET MVC3 Razor View In VB?

Jan 25, 2011

How do I reference a Namespace in .NET MVC3 with the Razor view engine?

I understand this can be done in C#:

@using Namespace;

However in VB this doesn't seem to work:

@Imports Namespace

(i'm talking about inside a .vbhtml file)

View 1 Replies

Adding And Removing Items From The List And Tree Views

Mar 10, 2009

I am trying to learn how to work with the different controls in Visual Studio for VB.Net in particular the List View and Tree Views. I don't have any code to show as I am not working on anything in particular just messing around with it to learn what the different controls do that weren't covered in my Intro to VB.Net class last semester.I would like a clearer explanation on how to actually use code for these controls. In particular adding and removing items from the List and Tree Views using code.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved