some time we need to make controls visible or invisible in dot net application. We should not do it manually every time. Here is a small method which can do that. You just send you visible and invisible controls as parameter.
public void VisiableInvisiable(Control[] visiables, Control[] invisiables)
{
foreach( Control visiable in visiables )
{
visiable.Visible = true;
}
foreach( Control invisiable [...]
Archive for September, 2007
control visible and invisible
Posted in C#.NET, tagged C#.net, controls on September 23, 2007 | Leave a Comment »
Login failed for user Machinename\ASPNET
Posted in General, tagged ASP, General on September 23, 2007 | 2 Comments »
I faced that problem when i run my application from localhost. Got the solution
Go to command prompt and write these commands. Take care of the spelling database name and tablename.
cd C:Program FilesMicrosoft SQL Server80ToolsBinn
osql -E -S localhost -Q “sp_grantlogin ‘MYCOMPUTERASPNET’”
osql -E -S localhost -d DatabaseName -Q “sp_grantdbaccess ‘MYCOMPUTERASPNET’”
osql -E -S localhost -d DatabaseName -Q “sp_addrolemember [...]
paging in asp:DataList
Posted in C#.NET, tagged asp:DataList, C#.net on September 21, 2007 | Leave a Comment »
asp:DataList has to paging option by default but it is easy to make pagination in datalist using “PagedDataSource Class”
HTML code is:
<table width=”100%”>
<tr><td>
<asp:DataList ID=”dlPhotos” Runat=”server” Width=”100%” ItemStyle-HorizontalAlign=”Left” RepeatLayout=”Table” RepeatDirection=”Horizontal” RepeatColumns=”4″ OnItemDataBound=”dlPhotos_ItemDataBound”>
<ItemTemplate>
<asp:Image id=”imgThumbnail” runat=”server” borderSize=”5″ />
</ItemTemplate>
</asp:DataList>
</td></tr>
<tr><td>
<table width=”100%”>
<tr>
<td align=”left”><asp:LinkButton runat=”server” ID=”lnkPrev” OnClick=”lnkPrev_Click” >Prev</asp:LinkButton></td>
<td align=”right”><asp:LinkButton runat=”server” ID=”lnkNext” OnClick=”lnkNext_Click” >Next</asp:LinkButton></td>
</tr>
</table>
</td></tr>
</table>
Code for the pagination is:
public void ShowPhotos()
{
try
{
PagedDataSource objPage = new PagedDataSource();
DataSet [...]
Components of Ajax
Posted in General, tagged AJAX on September 19, 2007 | Leave a Comment »
Ajax components are:
1. Javascript: Scripting language that commonly hosted in a browser to add interactively to HTML pages
2. DOM (Document Object Model): DOM is leveraged to efficiently redraw portions og hte pages.
3. CSS (Cascading Style Sheets) : modify the exterior of the user interface interactively
4. XMLHttpRequest: opposed to performing a full-page refresh or postback

