Wednesday, 24 September 2014

Standard
In this article I am explaining how to play (embed) WMV video file in ASP.Net using Silverlight Media Player.

To use the SilverLight Media Player Control in ASP.Net. You will have to first download and install

1. Visual Studio 2008 Service Pack 1

2. SilverLight 2.0 SDK


Once all these have installed, you can start building your Media Player Application. You will have to drag the MediaPlayer component from the Toolbox as shown in figure below.

By default there are no skins available when you install the .SilverLight Tools you can get the skin files in the Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server\MediaPlayerSkin Folder. Just add the skins to your project using Add Existing Items in Visual Studio.

Next using the smart tag to choose the skin and add the Media File to be played

You can also set other parameters like the

Volume - sets the volume of the Media Player Control

Auto-Play – determines whether the media file will be auto played or not when it is loaded.

You can also set the Media Source from code behind as shown below
_____________________________________________________________________________
C#

_________________________________________________________________________________

VB.NET

_________________________________________________________________________________

Once all these settings have been done you run the application. The figure below displays the SilverLight Media Player.


Friday, 19 September 2014

Deploy Project on IIS7 with Database

Standard
Here you know how to deploy you Project on IIS(Internet Information Services.) Localhost Server with Database,after deployment its easy to Run Project and easy to Access Database from another Computer in your Lan connection.


Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server created by Microsoft for use with Windows NT family.[2] IIS supports HTTP, HTTPS, FTP, FTPS, SMTP and NNTP. It has been an integral part of the Windows NT family since Windows NT 4.0, though it may be absent from some editions (e.g. Windows XP Home edition). IIS is not turned on by default when Windows is installed. The IIS Manager is accessed through the Microsoft Management Console or Administrative Tools in the Control Panel.

Step 1. You need to enable IIS in your local machine.Configure your IIS in local machine from Control Panel.It will take 1-2 minutes to configure your IIS.Below Images show step by step process to configure





Step 2. create your own application with database and then prepare your published project. After this go to Run and type inetmgr to open the local IIS. You can verify your IIS is working or not. Go to your browser and type localhost. It will open your IIS in browser. Now its time to add your application into IIS. Open your IIS and click on the Default under Site.



Step 3. Now on the Default you can see there are some sites are uploaded previously in the above image. Now click on the Application Pool and you can see there are previously created application pool. To create your own application pool click on the Add Application pool.



Step 4. Here input the name and .NET framework and save it. Now back to Site in your IIS. Select the Default and right click on the Default. Select Add Application.



Step 5 . After clicking on the link a window will be opened and there you have to give the alias name. It will be your site name. Suppose you are imputing "arka", so your site will be opened as localhost/arka. In the physical path select the folder where your published files are situated. Now a main thing, choosing the Application Pool in the DropDownList. Select your application pool that you have created. Now your site is ready to launch after clicking in the OK button.



Step 6 . Give your files and folders with full permission to access those from any other computer. To do that, select the root folder and go to properties. Within properties choose Security tab. Click on the Edit button and then Add button. From there go to Advance option and click on the Find Now to find your IIS User.



Step 7. Add your IIS_USERS to add users. Now another one important thing you have to do. Connect your .NET with IIS. To do that open your command and run these code according to your OS bit, either 32 or 64 bit. For 64 bit %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i For 32 bit %windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i It will install the ASP.NET with IIS connection. Now your application is ready to launch without database. It time to connect the database with your IIS. Open your SQL Management Studio and select your database. Under Security section click on the User, and Add New user.



Step 8. On the Login name click on the button beside and a new window will be opened with Login object. Click on the Browser and choose the application pool that you have created.



Step 9. Now after adding click on the OK to add the user. Now go to Server Security section and Add New Login



Step 10 . Now in the opened window go to User map section and choose your database.



Now click on the button on the left side another new window will be opened with Schema object. There write dbo and click on the Check name. Click on the OK button to proceed. Now back to User Mapping and check db_datawiter and db_datareader. Now again go to the security part of your database. Go to Securables and choose all the check boxes in Grant and click on the OK button. Now your application is fully configured to launch. Browse your site and ask your friends to browse your site from other computers in your LAN.

Tuesday, 16 September 2014

Modal Popup in ASP.NET using C#

Standard
Hi, today's topic is Modal popup using AJAX Modal Popup in ASP.NET using C#. Many times you have shown that, some message is showing by full masking the background(white/black). How to do that. Very easy to do.

Create a new project and add a new WebForm. Before proceeding add the extension of AJAX Control Toolkit (4.5, 4.0, 3.5).

In the tools section you will found Modal Popup Extender. Use this one to create popup.

Write down the following code to create a popup.

<form id="form1" runat="server">
<asp:scriptmanager id="ScriptManager1" runat="server">
 </asp:scriptmanager>
 <asp:button id="btnShow" runat="server" text="Show Modal Popup">
 <cc1:modalpopupextender backgroundcssclass="modalBackground" cancelcontrolid="btnClose" id="mp1" popupcontrolid="Panel1" runat="server" targetcontrolid="btnShow">
 </cc1:modalpopupextender>
 <asp:panel align="center" cssclass="modalPopup" id="Panel1" runat="server" style="display: none;">
  </asp:panel></asp:button><br>
<h1>
AJAX Modal Popup</h1>
Here is the content which you wan to show<br>
<asp:button id="btnClose" runat="server" text="Close"></asp:button>
</form>

PopupControlID : To visible the popup
CancelControl : To close the popup
TargetControl : To show div or panel in the popup


Run your project and test it with your first popup.

Output :