In dem Artikel "HTML Color Coding for various Languages" wird erklärt, wie man aus C#, VB.NET oder SQL-Sourcecode farbcodierten HTML-Output erzeugt.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Bei CodeProject wurde eine
Einführung in Events und Delegates mit C# veröffentlicht.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Greggm hat in seinem Blog einen Beitrag gepostet, der zeigt, wie man ASP.NET 1.1 ohne Admin-Rechte debuggen kann.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Scott Mitchell hat einen weiteren Artikel veröffentlicht:
"Understanding ASP.NET View State"
Der Artikel gibt auch einen Einblick in den Page Life Cycle von ASP.NET
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Will man eine DataTable von DataSet A nach DataSet B kopieren, erledigt man das mit folgendem Einzeiler:
dataSetB.Tables.Add(dataSetA.Tables[0].Copy());
In diesem Fall wird die erste Tabelle aus DataSet A als neue Tabelle in DataSet B angefügt.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Eine häufig gestellte Frage lautet: "Wie kann ich den Namen der aktuellen Datei auslesen?".
Mit Classic-ASP bzw. VBScript mußte man hierfür einige Zeilen Code aufwenden, in ASP.NET ist das Problem mit einem Einzeiler erschlagen:
string currentPageName = (Request.Url.Segments[Request.Url.Segments.Length-1]);
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Ab und zu steht man vor dem Problem, dass man gerne den HTML-Output eines WebControls hätte, z.B. um in einer HelperFunction im DataGrid einen Hyperlink zu generieren und diesen als kompletten String an den Caller zurückzuliefern.
Die Lösung ist eine kleine Funktion, die wie folgt aussieht:
using System;
using System.IO;
using System.Text;
using System.Web.UI;
namespace myNameSpace
{
public class Helpers
{
public static string RenderControlToString(System.Web.UI.WebControls.WebControl WebControl)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
WebControl.RenderControl(htw);
return sb.ToString();
}
}
}
Der Aufruf erfolgt über:
HyperLink hplWhereToYouWantToGo = new HyperLink();
hplWhereToYouWantToGo.NavigateUrl = "http://alexonasp.net";
hplWhereToYouWantToGo.Text = "Alex on ASP.NET";
string htmlOutput = Helpers.RenderControlToString(hplWhereToYouWantToGo);
Das Resultat: <a href="http://alexonasp.net">Alex on ASP.NET</a>
Currently rated 4.0 by 1 people
- Currently 4/5 Stars.
- 1
- 2
- 3
- 4
- 5
Durch das Posting "Why VS 2003 keeps changing your HTML and what you can (and cannot) do to it." in Mikhail Arkhipov's Blog, bin ich auf den Artikel "Walkthrough: Approaches to Building a Visual Studio .NET 2003 Add-in Project that Enables HTML Tidy" gestossen.
Abtstract: "The HTML Tidy utility developed by Dave Raggett identifies and corrects common HTML markup errors and adjusts markup formatting. The Microsoft® Visual Studio® .NET HTML Designer provides a default markup formatter and various Automatic Formatting options. Web developers who prefer to use HTML Tidy to correct and format their HTML markup can install a Visual Studio .NET 2003 add-in project that calls either the Tidy executable or the HTML Designer to perform Automatic Formatting. This article gives instructions on how to build, install, and run such an add-in project, and provides sample code in several development languages. (43 printed pages)"
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Abstract: "Creating our very own server controls is very easy... but when several controls share similar behavior and functionality, it is best to reuse it through inheritance. Sometimes, it may be better to start on an entire new leaf and sometimes, turn over a new forest. This is the second article in the series that Justin Lovell will publish over the next few weeks."
Reusing and Creating Server Controls
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Bei GotDotNet wurde ein interessantes Beispiel für die Implementierung rollenbasierter Sicherheit für ASP.NET veröffentlicht. Hierbei wird die Logik zur Prüfung in einer Basisklasse hinterlegt, die User-/Control-Zuordnung (welcher User darf welches Control sehen) ist in einer Xml-Datei definiert. Für die Verwendung mit Templates sicher in ausbaufähiger Ansatz...
GotDotNet User Sample:Implementing Role Based Security for User Interface (Aspx)
Currently rated 1.4 by 13 people
- Currently 1.384615/5 Stars.
- 1
- 2
- 3
- 4
- 5