|
hi friend,
Try this
string st=String.Format("{0:c}","control or string name"); assign this to control or string.
|
|
|
|
|
while sending the string which contains the html tags iam getting an error of unterminated string constant how to solve this problem
|
|
|
|
|
hi friend,
Need more information of where u r using it,also try to post the code snippet where u r getting the errors.
|
|
|
|
|
i mean in grid view row databound iam adding an attribute to get javascript fired when that link button is clicked.for this javascript function iam sending the string that contains the javascript.then only iam getting this error stating unterminated string constant error it is coming .
|
|
|
|
|
Check for apostrophes inside the HTML in your code.
i hope this is your problem. becoz i dont have your code to see otherwise we can easily find out what is the problem?
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
if apostrophes is there how to handle while passing to the javascript
|
|
|
|
|
Hi,
We had written a code in ASP in which we are doing HTTP POST using an HTTP URL. This was done locally. We were sending some credit card deatils.
When we deployed the code on server, we tried using HTTP POST using HTTPS URL. There is already a certificate issued for this.
The HTTTP POST using https is not working. I want to know if it is a certificate issue or do i have to do some changes in the code if i try to use HTTP POST on HTTPS URL?
The HTTP POST code is as follows:
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", strURL, False
Plz help.
Regards,
Riz
|
|
|
|
|
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?
|
|
|
|