Beyond Web Logs

Discuss technology, web development, networks and more ...

Recent posts

Tags

First time here? At BeyondWebLogs we discuss technology, web development, personal development, networks and more. You can subscribe to the RSS feed so that you keep up to date with the latest content. Now, on with the regular content...

manual backup of your windows sharepoint services [wss] site

Ever wondered how to take a full manual backup of your windows sharepoint services 3.0 [wss] site? Of course you can use stsadm command to do a full backup but you'll have to run this command every time you need to take your site's backup.

Below is a .bat script that you can use to automate this manual process. It automatically creates a filename for you and takes your wss site's backup. You can schedule this .bat file using windows schedule and your wss site's backup will take care of itself.

... and here's the script:

@echo off
echo +++++++++++++++++
echo Initializing backup...
echo Starting backup...
echo +++++++++++++++++
for /f "delims=/ tokens=1-3" %%a in ("%DATE:~4%") do (
        for /f "delims=:. tokens=1-4" %%m in ("%TIME: =0%") do (
            set FILENAME=site_backup-%%c-%%b-%%a-%%m%%n%%o%%p
        )
    )

c:
cd \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
@echo off
stsadm.exe -o backup -url http://server -filename D:\%FILENAME%.dat -overwrite
echo Backup complete.

Simply copy, and then save the above script as a .bat file, and that's it.

Hope it helps, as it definitely helped me. As always, thank you to all those who helped me create this script.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET | General | How To | SharePoint
Posted by muneeb on Monday, August 04, 2008 7:30 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Debug JavaScript in Visual Studio

With Visual Studio, you can debug ASP.NET applications using the integrated debugger. To take advantage of the Visual Studio debugger, ASP.NET applications must run in debug mode. The compilation mode can be set by modifying the web.config file of the website accordingly.
Visual Studio also lets you debug script files loaded by the browser at runtime. First, let’s see how to configure IE for web-page debugging. Then, we’ll explain how to set breakpoints in JavaScript files through the Script Explorer window.

To enable script debugging in IE, open the Internet Options dialog and ensure that the following items are deselected:

  • Disable Script Debugging (Internet Explorer)
  • Disable Script Debugging (Other)

Following figure shows the Internet Options dialog in IE 7, but the same settings apply to IE 6.

IESettings 
Once script debugging is enabled in IE, you can set up the Visual Studio environment. Let’s see how this is
done.

Normally, the client code loaded in a web page is contained both in script tags in the page as well as in separate
files loaded by the browser. Visual Studio doesn’t permit you to set breakpoints in the JavaScript code contained in an ASPX page. But setting breakpoints in separate script files (for example, JavaScript files with the .js extension) sometimes result in errors being raised by the Visual Studio debugger. Let’s see what you can do to work around these limitations. To set breakpoints in the JavaScript code contained in an ASPX page, you must break into the debugger at a specific location in the code. You can do this by adding a statement with the debugger keyword at the specific location:

debugger;

The debugger keyword stops the execution of the program and enters the Visual Studio debugger. In the debugger, a new tab opens with the source code of the page you’re currently browsing. Now, you can set breakpoints in the source code tab. Once you’ve set breakpoints, you need to reload the page in the browser in order to debug it.
Figure B.25 shows the source code tab with the debugger statement added to the pageLoad function. Note that you’re setting breakpoints in the source code tab and not in the original ASPX page, which is the inactive tab in the figure.

 

VSDebugger

Sometimes, when you set breakpoints in JavaScript files, the debugger complains at runtime, saying that “There’s no source code available for this location” and displaying a warning dialog. This happens because script files are loaded dynamically in the page. In such cases, you have to rely on the Script Explorer window to set breakpoints in JavaScript files.


To open the Script Explorer window, choose Debug > Windows > Script Explorer. If you don’t see the Script Explorer menu item, choose Tools > Customize. In the new window, select Debug > Script Explorer. You can also drag the
Script Explorer icon to a Visual Studio toolbar to add it automatically.
The Script Explorer window lists all the script files loaded in the page you’re debugging. If you double-click a file, the file opens in a new tab, and you can set breakpoints; see following figure. Once you set breakpoints, you have to reload the web page in order to debug the code.

jsdebugging

Hope this helps!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET | Tips n Tricks
Posted by Waqas on Sunday, June 08, 2008 12:21 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Free ASP.NET PopUp Calendar - Open Source Date Picker Control for ASP.NET

There is a new popup calendar control in town named "RJS PopCalendar". Very cool, slick, easy to use and most importantly FREE :)

Use following links for more details:

Free ASP.NET PopUp Calendar 

Walkthrough of Implementation in ASP.NET Web Application 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET
Posted by Waqas on Wednesday, June 04, 2008 11:51 AM
Permalink | Comments (1) | Post RSSRSS comment feed

How to Reduce Page Load Time with ASP.NET AJAX

A very nice trick with tab controls to asynchronously load their content in the background and improve perceived page load time.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET | Tips n Tricks
Posted by Waqas on Monday, April 28, 2008 3:07 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Windows Authentication in ASP.NET

If your application is targeted for use inside an organization, and users accessing the application have existing user accounts within the local user database of the Web server or Active directory, you should authenticate users with Windows authentication.

You can configure Windows authentication in two ways: within IIS and within your ASP.NET application. To provide defense in depth, use both techniques to require authentication.

When a Web application requires Windows authentication, the application rejects any request that does not include a valid user name and password in the request header. The user’s browser then prompts the user for a user name and password. Because the browser prompts the user for credentials, you do not have to create a page to request the user’s user name and password. Some browsers, such as Microsoft Internet Explorer, automatically provide the user’s current user name and passwordwhen the server is located on the intranet. This seamlessly authenticates the user, relieving the need to retype the password for intranet site visits. Additionally, because users are authenticated against the server’s local user database or Active Directory domain, using Windows authentication saves you from creating a database to store user credentials. Leveraging the Windows authentication mechanism is, therefore, the simplest way to authenticate users. To configure IIS to require all users to authenticate on computers running Microsoft Windows Server 2003, follow these steps:

1.In the Administrative Tools program group, open the IIS Manager.
2.In the IIS Manager console, click to expand your server name, to expand Web Sites, and then to expand the Web site.
3.Right-click the site or folder name you are configuring authentication for and select Properties.
4.Click the Directory Security tab. In the Authentication And Access Control group, click the Edit button.
5.Clear the Enable Anonymous Access check box, which is selected by default.
6.Select the Integrated Windows Authentication check box, as shown below.


Optionally, select Digest Windows Authentication For Windows Domain Servers to enable authentication across proxy servers.

7. Click OK twice to return to the IIS Manager console. At this point, all Web requests to the virtual directory will require Windows authentication, even if ASP.NET is configured for anonymous access only. Even though configuring IIS is sufficient to require users to present Windows credentials, it is good practice to edit the application’s Web.config file to also require Windows authentication.

To configure an ASP.NET application for Windows Authentication, edit the <authen-tication> section of the Web.config file. This section, like most sections related to ASP.NET application configuration, must be defined within the <system.web> section. The <system.web> section, in turn, must exist within the <configuration> section. This example shows the <authentication> section of the Web.config file configured to use Windows authentication:

<configuration>
<system.web>
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>

To restrict access to only users in the specified group, you must explicitly deny access to users who are not specifically granted access, as the following code demonstrates:

<system.web>
<authorization>
<allow roles="BeyondWebLogs\IT" />
<deny users="*" />
</authorization>
</system.web>

Above code will only allow BeyondWebLogs\IT group users to access application, while denying all other users. Similarly, users can also be specifed to allow/deny access as shown below:

<system.web>
<authorization>
<allow users="BeyondWebLogs\waqas, BeyondWebLogs\muneeb" />
<deny users="*" />
</authorization>
</system.web>

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET | How To
Posted by Waqas on Monday, April 07, 2008 8:30 PM
Permalink | Comments (0) | Post RSSRSS comment feed

How to tell IIS Application or Virtual Directory to use ASP.NET 3.5 rather than ASP.NET 2.0

A very nice article by Scott Hanselman on this fundamental question:

How do I tell my IIS Application or Virtual Directory to use ASP.NET 3.5 rather than ASP.NET 2.0?

EnjoY!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: ASP.NET
Posted by Waqas on Tuesday, April 01, 2008 4:09 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Cannot find DBF file in a given folder

Ever tried to connect to a .dbf file in .NET and gotten a Microsoft JET OleDB error that the file does not exist or something? You know the file is there because you've double checked and you know you've given the correct path but still no cigars? Here'e a reason why: Microsoft JET OleDB driver for dBase .DBF files does NOT support filesize greater than 8 characters! So, all you have to do is rename your .dbf file to 8 or less than 8 characters and you'll be good.

 [Thanks to https://msmvps.com/blogs/access/archive/2007/09/10/microsoft-jet-database-engine-could-not-find-object-xyz-dbf.aspx for this tip!]

 Hope it helps!

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by muneeb on Tuesday, March 04, 2008 4:20 PM
Permalink | Comments (1) | Post RSSRSS comment feed