With all the care it takes, Mark Smith explains the method
http://www.worldofasp.net/tut/1/Use_Csharp_and_VBNET_in_the_same_project_107.aspx
Thursday, September 25, 2008
Visual Basic 9.0 Feature Focus - LINQ Queries
Bart's article on new features of VB9 about LINQ
http://community.bartdesmet.net/blogs/bart/archive/2007/09/05/visual-basic-9-0-feature-focus-linq-queries.aspx
http://community.bartdesmet.net/blogs/bart/archive/2007/09/05/visual-basic-9-0-feature-focus-linq-queries.aspx
Wednesday, September 24, 2008
VB.NET Imports Alias
In case of you missed Python 'import as' :-)
Here the VB.NET equivalent
Imports cfg = System.Configuration.ConfigurationSettings
http://weblogs.asp.net/eporter/archive/2003/08/12/23892.aspx
Here the VB.NET equivalent
Imports cfg = System.Configuration.ConfigurationSettings
http://weblogs.asp.net/eporter/archive/2003/08/12/23892.aspx
Control ID Naming in Content Pages
The renaming id when using Master Pages
can be a pain
Here is an article to get out of it
http://www.asp.net/LEARN/master-pages/tutorial-05-vb.aspx
can be a pain
Here is an article to get out of it
http://www.asp.net/LEARN/master-pages/tutorial-05-vb.aspx
Tuesday, September 23, 2008
ASP.NET et Javascript en code-behind
One article in french :
http://dotnet.developpez.com/faq/asp/vbnet/?page=js_introduction
http://dotnet.developpez.com/faq/asp/vbnet/?page=js_introduction
Monday, September 22, 2008
Filling a dropdownlist with LINQ
Partial Public Class _Default
Inherits System.Web.UI.Page
Dim northwind As New northwindDataContext()
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim categories = From categorie In northwind.Categories _
Select categorie
DropDownList1.DataSource = categories
DropDownList1.DataTextField = "CategoryName"
DropDownList1.DataValueField = "CategoryID"
DropDownList1.DataBind()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim selectValue = DropDownList1.SelectedItem.Value
Dim products = From product In northwind.Products _
Where product.CategoryID = selectValue
GridView1.DataSource = products
GridView1.DataBind()
End Sub
End Class
The ASPX Page
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />
<hr />
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
Transmit Forms Data to another ASP.NET page
A dicscussion a bout this problem
http://www.velocityreviews.com/forums/t67347-how-aspnet-page-gets-user-input-from-another-aspnet-page.html
And from Microsoft
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx
http://www.velocityreviews.com/forums/t67347-how-aspnet-page-gets-user-input-from-another-aspnet-page.html
And from Microsoft
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx
Sunday, September 21, 2008
LINQ to XML
Simple Query Sample
Sample File
<books>
<book><title>Python</title><author>Guido</author></book>
<book><title>Haskell</title><author>Books</author></book>
</books>
Module Module1
Sub Main()
Dim doc = XDocument.Load("c:\books.xml").Elements
Dim query = From data In doc.Elements _
Where data.Element("title") = "Python"
For Each g In query
Console.WriteLine(g.Element("author").Value)
Next
Console.ReadLine()
End Sub
End Module
Sample File
<books>
<book><title>Python</title><author>Guido</author></book>
<book><title>Haskell</title><author>Books</author></book>
</books>
LINQ to XML Samples
A few samples on querying XML with LINQ
http://www.thomasclaudiushuber.com/blog/tag/linq/
http://www.thomasclaudiushuber.com/blog/tag/linq/
Subscribe to:
Posts (Atom)