|
Hi,
In my web application am using Samrtnavigation in web.config file
<pages smartNavigation="true">
And when i try to set Focus for my text box, like
TextBox1.Focus() it's not working. I've tried javascript and other stuffs.
Can any one here to help? Pls
Regards n Thks
Sam.M
|
|
|
|
|
Hi friend,
use this code if u r using javascript or the other if u r using VB.net.
Page.RegisterClientScriptBlock("focus", _
"document.<id-of-your-control>.focus();")
or (VB.NET)
Page.RegisterClientScriptBlock("focus", _
"" & _
"document.<id-of-your-control>.focus();" & _
"</id-of-your-control> ")
|
|
|
|
|
Sorry friend. This is not working. I've tried. Do u've anyother solution for this?
Regards n Thks
Sam.M
|
|
|
|
|
Try this code:
[VB.NET]
Page.RegisterStartupScript("SetFocus", _
"<script>document.getElementById('" & TextBox1.ClientID & _
"').focus();</script>")
[C#]
Page.RegisterStartupScript("SetFocus", "<script>document.getElementById('" + TextBox1.ClientID + "').focus();</script>");
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi all,
Can you help me in paging the datalist below,i tried many ways but i couldn't.Please help me out with the code.
<asp:DataList ID="MyList" RepeatDirection="Horizontal" RepeatColumns="2" runat="server" Width="263px" Height="1px" Font-Size="XX-Small">
<SeparatorStyle Wrap="False" HorizontalAlign="Center" BorderWidth="10px" BorderStyle="None" Width="10px"
BackColor="White"></SeparatorStyle>
<ItemTemplate>
<table style="text-transform: capitalize; color: #cccc99; font-family: 'Courier New'; font-variant: normal" border="1" cellpadding="0" cellspacing="0" bordercolor="#cccc99">
<tr>
<td >
<table >
<tr><td>
<table >
<tr>
<td rowspan="6" style="width: 3px">
<a href="#" runat="server" id="a1"> <img onclick="javascript:window.open('details.aspx?mid=<%# DataBinder.Eval(Container, "DataItem.MemberID") %>','_blank','menubar=no,scrollbars=yes,toolbar=no,resizable=yes,status=no,location=yes');" border="0" src="<%# RetnImage(DataBinder.Eval(Container,"DataItem.Photo1").ToString()) %>" width="100" height="120" id="imguser"> </a></td>
<td style="width: 3px; height: 23px">
Name:<asp:Label ID="txtname" Text='<%#DataBinder.Eval(Container,"DataItem.Name")%>' runat="server" ></asp:Label></td>
</tr>
<tr>
<td style="width: 3px; height: 21px">
Age:<asp:Label ID="txtage" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.Age")%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 3px">
Qualification:<asp:Label ID="txtqlfn" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.HighestDegree")%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 3px">
Denomination:<asp:Label ID="txtdenomination" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.Denomination")%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 3px">
MaritalStatus:<asp:Label ID="txtmstatus" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.MaritalStatus")%>'></asp:Label></td>
</tr> </table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
Thanks in Advance
|
|
|
|
|
Hi friend,
Try the contents given in this URL,a example for the repeater control is demonstrated here u hv to use a datalist instead of a repeater control.pls try this site.
To the site
|
|
|
|
|
Hi
I have upload the image in asp.net
when i upload the image that is going to be stored in database and also store the filename in the Images folder
of my project folder... so i have bind the images to the datalist when i move the mouse over the images binded on datalist it shud enlarge the images
whether using javascript or codebehind..
Let anyone give the solution pls..
Thanks i advance
modified on Wednesday, October 15, 2008 10:43 PM
|
|
|
|
|
|
Hello folks,
I was using a table layout to display controls on my page in such a way that the page will be divided into four sections as shown below:
table
tr
td 1 /td
td 2 /td
/tr/
tr
td 3 /td
td 4 /td
/tr
table
and another row and column etc.
For some reason, I'm running into issues with formatting and apparently there's a lot of space between every row (note that I'm not setting any explicit properties on tr elements)
Anyways, i wanna remove this table layout and use div and span elements instead.
The scenario is that I have a few controls (such as buttons, labels etc) that are encapsulated in a panel.
I have another set of controls (labels, buttons, grid view etc) that are also encapsulated in a panel.
I want these two panels side by side. So I'm putting both of these in a div and setting the display property to inline. This doesn't put the second panel to the right of the first panel.
Can someone please show me what other properties that needs to be set to accopmplish such behavior.
Tina
|
|
|
|
|
I'm no expert with layout design, but why dont you put two divs with float left and float right?
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
How does one go about changing the style of the Browse button in the FileDownload control?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
How can i send email in asp.net by Language vb like invitation friend
to site?
|
|
|
|
|
Its in C#, but you could easily realize how to do it in vb.
MailMessage yourEmail = new MailMessage(FROM_EMAIL_ADDRESS, TO_EMAIL_ADDRESS);
yourEmail.Subject = "Your Email Subject";
SmtpClient smtpServer = new SmtpClient(SMTP_SERVER);
smtpServer.Credentials = new NetworkCredential(SMTP_USER, SMTP_PASSWORD);
smtpServer.Send(yourEmail);
Intelligence is almost useless for those who have nothing else!
Email: caiokf@gmail.com
|
|
|
|
|
Hi,
I have used cssfriendly to create a vertical menu with attractive look.Too late I discovered that it doesn't work correctly in IE6 because it jumps from the right side to the left when the mouse hover on it.Also it is shifted to the left while I made it to align to the right as it appears correctly in IE7.
Another problem I discovered is that my login control and its validation are not working correctly its code is as following:
<div style="width:50%;">
<asp:LoginView ID="logv1" runat="server">
<AnonymousTemplate>
<asp:Login ID="login1" runat="server" FailureAction="RedirectToLoginPage" DestinationPageUrl="Default.aspx" >
<LayoutTemplate>
<asp:Label ID="lblUserName" runat="server" Text="اسم المستخدم" AssociatedControlID="UserName" Width="50%" />
<asp:TextBox ID="UserName" runat="server" Width="50%" />
<asp:RequiredFieldValidator ID="vldUserName" runat="server" ValidationGroup="LoginGroup" ControlToValidate="UserName" Text="*" ErrorMessage="مطلوب اسم المستخدم"></asp:RequiredFieldValidator>
<br />
<asp:Label ID="lblPassword" runat="server" Text="كـلـمـة السـر" AssociatedControlID="Password" Width="50%" />
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="50%" />
<asp:RequiredFieldValidator ID="vldPassword" runat="server" ControlToValidate="Password" ValidationGroup="LoginGroup" Text="*" ErrorMessage="مطلوب ادخال كلمة السر"></asp:RequiredFieldValidator>
<br />
<asp:ImageButton ID="Submit" runat="server" CommandName="Login" ImageUrl="~/images/login.gif"/>
<br />
<asp:ValidationSummary ID="vldsum" runat="server" ShowMessageBox="true" ShowSummary="false" />
<br />
<asp:CheckBox ID="RememberMe" runat="server" Text="حفظ اسم الدخول"
Visible="true" />
<br />
</LayoutTemplate>
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
</div>
Which I put in login page so when access is denied it should go to this page.
The validation controls for the CreateUserWizard are not working at all what ever I do which is as following:
<div id="NewUser">
<asp:CreateUserWizard ID="createUser1" runat="server" AutoGeneratePassword="False" ContinueDestinationPageUrl="~/Default.aspx" FinishDestinationPageUrl="~/Default.aspx"
OnCreatedUser="CreateUserWizard1_CreatedUser" CreateUserButtonImageUrl="../images/btninsert.gif" CreateUserButtonType="Image"
>
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" >
<ContentTemplate>
<div >إضافة مستخدم جديد</div>
<br />
<br />
<table cellpadding="2">
<tr>
<td class="TextField" style="width: 110px;" ><asp:Label runat="server" ID="lblUserName" Text="اسم المستخدم" AssociatedControlID="UserName" /></td>
<td class="TextField" style="width: 300px;"><asp:TextBox ID="UserName" runat="server" Width="100%"></asp:TextBox></td>
<td><asp:RequiredFieldValidator ID="valRequireUserName" runat="server" ControlToValidate="UserName" ValidationGroup="CreateUserWizard1" SetFocusOnError="true" ErrorMessage="مطلوب اسم المستخدم">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td class="TextField"><asp:Label runat="server" ID="lblPassword" AssociatedControlID="Password" Text="كلمة المرور" /></td>
<td class="TextField"><asp:TextBox runat="server" ID="Password" TextMode="Password" Width="100%" /></td>
<td>
<asp:RequiredFieldValidator ID="valRequirePassword" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
ErrorMessage="مطلوب كلمة السر" ToolTip="مطلوب كلمة السر" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
ValidationExpression="\W{5}" ErrorMessage="كلمة السر يجب أن لاتقل عن خمسة أحرف" ToolTip="كلمة السر يجب أن لاتقل عن خمسة أحرف"
ValidationGroup="CreateUserWizard1">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="TextField"><asp:Label runat="server" ID="lblConfirmPassword" AssociatedControlID="ConfirmPassword" Text="تأكيد كلمة المرور" /></td>
<td class="TextField"><asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" Width="100%" /></td>
<td> <asp:RequiredFieldValidator ID="valRequireConfirmPassword" runat="server" ControlToValidate="ConfirmPassword" SetFocusOnError="true" Display="Dynamic"
ErrorMessage="يلزم تأكيد كلمة المرور" ToolTip="يلزم تأكيد كلمة المرور"
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="valComparePasswords" runat="server" ControlToCompare="Password" SetFocusOnError="true"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="يلزم تطابق كلمة المرور وتأكيد كلمة المرور"
ValidationGroup="CreateUserWizard1">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td class="TextField"><asp:Label runat="server" ID="lblEmail" AssociatedControlID="Email" Text="البريد الإلكتروني" /></td>
<td class="TextField"><asp:TextBox runat="server" ID="Email" Width="100%" /></td>
<td>
<asp:RequiredFieldValidator ID="valRequireEmail" runat="server" ControlToValidate="Email" SetFocusOnError="true" Display="Dynamic"
ErrorMessage="مطلوب البريد الإلكتروني" ToolTip="يلزم إدخال البريد الإلكتروني" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator runat="server" ID="valEmailPattern" Display="Dynamic" SetFocusOnError="true" ValidationGroup="CreateUserWizard1"
ControlToValidate="Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage="البريد الإلكتروني الذي أدخلته ليس بصيغة صحيحه">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:ValidationSummary ValidationGroup="CreateUserWizard1" ID="ValidationSummary1" runat="server" ShowMessageBox="true" ShowSummary="false" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
<ContentTemplate>
<table border="0">
<tr>
<td>
تم إنشاء سجل باسم مستخدم جديد</td>
</tr>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</div>
So may be CssFriendly caused this problem too.Could any one help?
I am too late but i will never give up
|
|
|
|
|
i want to declare a webcontrol in my webservice then pass it through a function that will render it to a string then return the value. How do i declare it?
example
dim myControl as new ASP.MyWebcontrol
return RenderMy(mycontrol)
Public Function RenderMy(ByVal ctrl As Control) As String
Dim sb As New StringBuilder()
Dim tw As New IO.StringWriter(sb)
Dim hw As New HtmlTextWriter(tw)
ctrl.RenderControl(hw)
Return sb.ToString()
End Function
|
|
|
|
|
|
Hi, have a look at the following code:
aspx file
###
<body>
<form id="form1" runat="server">
<div>
<asp:GridView AutoGenerateColumns="false" ID="grdNoFlashInstances" Runat="server">
<Columns><asp:TemplateField ShowHeader="False"><ItemTemplate>
<GL:ItemWI ID="AloneItem" Width="170" runat="server"
CornerLeftTopImagePath="../App_Themes/Images/Item_Corner_Left.gif"
CenterTopImagePath="../App_Themes/Images/Item_Line.gif"
CornerRightTopImagePath="../App_Themes/Images/Item_Corner_Right.gif"
CornerLeftMiddleImagePath="../App_Themes/Images/Item_vertical.gif"
CenterMiddleBackgroundPath="../App_Themes/Images/Item_bg.gif"
CenterMiddleImagePath='<%#DataBinder.Eval(Container.DataItem, "ImageName") %>'
CornerLeftButtomImagePath="../App_Themes/Images/Item_Square2.gif"
CenterButtomImagePath="../App_Themes/Images/Item_Line.gif"
CornerRightButtomImagePath="../App_Themes/Images/Item_Square.gif.gif"
FooterLeftImagePath="../App_Themes/Images/Item_bttnleft.gif"
FooterMiddleBackgroundPath="../App_Themes/Images/Item_Header.gif"
NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "WebAddress") %>'
FooterMiddleText='<%# DataBinder.Eval(Container.DataItem, "Title") %>' />
</ItemTemplate></asp:TemplateField></Columns>
</asp:GridView>
</div>
</form>
</body>
###
code behind file:
###
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!Page.IsPostBack)<br />
{<br />
string prePath = ConfigurationManager.AppSettings["ImageBase"].ToString();<br />
string preWIPath = ConfigurationManager.AppSettings["ImageBase"].ToString() + ConfigurationManager.AppSettings["ImageBase_WorkInstances"].ToString();<br />
WorkInstance workInstance = new WorkInstance();<br />
SqlDataReader dr;<br />
dr = workInstance.GetNotFlashItems();<br />
if (dr.HasRows)<br />
{<br />
alone<br />
grdNoFlashInstances.DataSource = dr;<br />
grdNoFlashInstances.DataBind();<br />
}<br />
dr.Close();<br />
}<br />
}
###
setting the property "CenterMiddleImagePath":
How should it be?
Answer: the saved value in database is just the filename. but path of the files should be retrieved from the file web.config and set to the variable prepath as the following. so the value of the above property is preWIPath + DataBinder.Eval(Container.DataItem, "ImageName")
string prePath = ConfigurationManager.AppSettings["ImageBase"].ToString();
string preWIPath = ConfigurationManager.AppSettings["ImageBase"].ToString() + ConfigurationManager.AppSettings["ImageBase_WorkInstances"].ToString();
QUESTION:How do I format the code in the source of the aspx file to setting the above property as said?
Trying other way:I wanted to setting the above the property in the code (.cs) file, but it say the The name 'AloneItem' does not exist in the current context?!!!
Question:How can I do it from the code file?
|
|
|
|
|
Hello, I am trying to create a custom control for creating tabs. The idea is that our designer can just use the control tags to generate the tabs. The problem that I am running into is that I want to be able to have a custom control that allows any number of child custom controls. So there would be a TabContainer Control, and within that there would be any number of tabs. The idea is similar to how an asp:DropDown list can have any number of ListItems within them. Here is my code, any help is appreciated.
1 <!-- TAB CONTAINER -->
2 <%@ Control Language="VB" AutoEventWireup="false" CodeFile="TabContainer.ascx.vb" Inherits="CustomControls_TabContainer" %>
3 <div>
4
5 <ul class="tabs">
6 <asp:placeholder id="ph_list_items" xmlns:asp="#unknown">
7
8 </asp:placeholder>
9 </ul>
10
11 </div>
12
13
14 <%@ Control Language="VB" AutoEventWireup="false" CodeFile="Tab.ascx.vb" Inherits="CustomControls_Tab" %>
15 <li>
16 <asp:hyperlink id="hp_link" runat="server" xmlns:asp="#unknown" />
17 </li>
18
19
20 <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
21 <%@ Register
22 TagPrefix="uc"
23 TagName="TabContainer"
24 src="~\CustomControls\TabContainer.ascx" %>
25 <%@ Register
26 TagPrefix="uc"
27 TagName="Tab"
28 src="~\CustomControls\Tab.ascx" %>
29
30
31
32 <html xmlns="http://www.w3.org/1999/xhtml">
33 <head runat="server">
34 </head>
35 <body>
36 <form id="form1" runat="server">
37 <div>
38
39 <uc:tabcontainer id="tabs1" runat="server" includearrows="True" xmlns:uc="#unknown">
40 <uc:tab id="tab1" runat="server" linktext="Tab1" linkurl="http://www.google.com" />
41 <uc:tab id="tab2" runat="server" linktext="Tab1" linkurl="http://www.google.com" />
42 <uc:tab id="tab3" runat="server" linktext="Tab1" linkurl="http://www.google.com" />
43 </uc:tabcontainer>
44 </div>
45 </form>
46 </body>
47 </html>
|
|
|
|
|
Hello,
I am Working with Visual Studio 2005.
I have taken update panel(ajax), when i am using update panel, tabindex and validation controls are not working.
I can't understood why it is not working. can i have to change any properties while using update panel.
Please Help me...Urgent
Looking forward for reply
Thanks in advance...
Pinna
|
|
|
|
|
|
Hi,
I want you to help me in deploying a asp.net 2.0 web application which makes use of sql database.
Generally, the process that i follow is:
I will generate a sql script of my databse, export the data into excell file.
And, i will copy my project and create a virtual directory in the server.
Then i will run the sql script in the sql query analyser of server and import the excell data sheet.
This holds good for within the LAN.
But, now my requirement is i want to pack database and my project into a single exe file. So, that when the client installs in his server, the databse connects automatically and the project works fine...
Please help me...Its urjent.
|
|
|
|
|
You can create the scripts for the database structure as well as forthe data
In your app detect when it is the firs time use and ask the user to choose the server user and password, using that, connect to the server and execute the scripts, also save the server, user and password in webconfig for later use by your app
Alexei Rodriguez
|
|
|
|
|
Can you be more clear.?
I mean how to attach the created database scripts to web setup project.?
|
|
|
|
|
I am new a themes and skins so please bare with me. What I have is a gridview that rows contain textboxes and dropdowns in the row's columns. What I need to do is design a skin for the gridview that allows the entire row, controls and all, to appear yellow (background) once the row is selected. I have a default skin for the gridview and plan to modify this to meet my needs. Can anyone provide recommendations as to the best way to do this?
Thanks,
Steve
|
|
|
|