Posts

Showing posts from November, 2011

Sharepoint Form Validation using Javascript

Image
1.First open the Newform.aspx which you want to validate.(go to list and go to "New item" page) 2.then add ?PageView=Shared&ToolPaneView=2 part at the end of the urlEx: http://mysite/Lists/job/NewForm.aspx http://mysite/Lists/job/NewForm.aspx?PageView=Shared&ToolPaneView=2 3. Add "Content editor web part " and modify this web part with source editor option 4. Add following javascript which use to validate start date & due date 5. Now use it... 6. If you want to use javascript to validate other field just put following script and modify it as you wish.. <Script language="javascript"> function PreSaveAction() { //add your JavaScript code here and return true / false } </ Script >

Get Client Machine name from web app

Image
If you want to get the client PC name, you can use the following code block. string computer_name; string[] Host_Name = System.Net.Dns.GetHostEntry(Request.ServerVariables["REMOTE_HOST"]).HostName.Split(new Char[] { '.' }); computer_name = Host_Name [0].ToUpper();

Run-time XAML code compiler

Image
XAML (Extensible Application Markup Language)  is a declarative markup language. As applied to the .NET Framework programming model, XAML simplifies creating a UI for a .NET Framework application. You can create visible UI elements in the declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files, joined to the markup through partial class definitions. In both WPF and Silverlight interfaces designing use XAML. In this post I'll show how to execute and display user entered XAML code at the runtime. first you have to create a silverlight application add a text box to take the user inputs (editingTxt) add a text box to display error messages (statusTextBlock) add a border controller to display the output (output) add a button control and put the following code in to button click event             object obj;             try             {                 obj = XamlReader.Load(editingTxt.text);