|
Use a RequiredFieldValidator . It don't allow spaces.
|
|
|
|
|
great
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
I Have done a small C# Application in UserControl, then i taken that DLL into our webapplication then i make it as ActiveX in the Help of
<object ..........=""> tag it's working fine..........
But second time i just add the some COM components into C# application usercontrol then i make as a ActiveX but this time I couldn't get the corresponding usercontrol into my Web application...........
Is it there any other Tag i've import into web application for work out this kind of Concepts..........
|
|
|
|
|
Hi i have multiple user type in webconfig file appsettings like this:
<add key="Admin" value="Admin" />
<add key="User" value="User" />
How to bind this values in to my dropdownlistbox?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
modified on Friday, July 4, 2008 1:06 AM
|
|
|
|
|
loop
I don't know how to write my signture!
|
|
|
|
|
what loop?,
What ur trying to say?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
How to add this User types in to my dropdown list:
<add key="UserType" value="Admin,User,Guest"/>
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Try this
<br />
Dim str As String = ConfigurationSettings.AppSettings("UserType")<br />
<br />
DropDownList1.DataSource = str.Split(",")<br />
<br />
DropDownList1.DataBind()<br />
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Hey Sorry i got o/p,
Thank u
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Its a vb.net code, I think you are using C#.
make some syntax change, It will work
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
String str = ConfigurationSettings.AppSettings["UserType"];
DropDownList1.DataSource = str.Split(',');
DropDownList1.DataBind();
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
I have a editable grid in which i have to format some numbers, I have to display numbers in Number format( ex. 1,233) and decimals in Decimal format (Ex: 1,233.45). Now I am displaying using this format({0,0.00}). But my problem is it is displaying the numbers also in decimals (ex: 1,233.00). How can i display numbers in number format and decimals in decimal format.. Is there any format string for displaying like this..
Thanks In advance
Satish Reddy.D
Satish Reddy.D
|
|
|
|
|
how to deploying mutiple web application in one setup ?
|
|
|
|
|
I am using asp.net with c#.In my project i am using master page .Each form are child of this master page.I want to check textbox null in clild master page using javascript.
I use the following code to check null.
butSubmit.Attributes.Add("OnClick", "return val()");
function val()
{
if(document.getElementById("TextBox1").value=="")
{
return;
}
}
but its not working.If, without using the master page it work properly.In my child master page there is no form tag.Because in my master page i use teeview so form tag is placed in master page.If anyone understand my probelm pls .
|
|
|
|
|
Where the text box is? In Master page or content page(child page)?
deepthy.p.m wrote: I want to check textbox null in clild master page using javascript.
How many master pages are there?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
|
JS Function
<br />
function val(cntrl)<br />
{<br />
if(document.getElementById(cntrl).value=="")<br />
{<br />
return false;<br />
}<br />
}<br />
deepthy.p.m wrote: butSubmit.Attributes.Add("OnClick", "return val()");
<br />
btnsubmit.Attributes.Add("onclick", "return val('" + TextBox1.ClientID + "')")<br />
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
|
Hi Net Experts!
This maybe a simple question for you all, but I have not been able to get it works, I created a web form page .aspx, and a user control file .ascx. Here is the code in my .ascx file
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlFormBookSearch.ascx.cs" Inherits="Control_ControlFormBookSearch" %>
<table style="padding:0; border:solid 0px;">
<tr valign="middle">
<td style="vertical-align:top;border-bottom:solid 0px">
Keyword: <asp:TextBox ID="searchValue" runat="server" />
</td>
</tr>
</table>
From my web form .aspx file, I wanted to access the control searchType this way:
<%@ Register src="ControlBookDetail.ascx" tagname="ControlBookDetail" tagprefix="uc9" %>
<script runat="server">
protected void btnSearch_Click(object sender, EventArgs e)
{
TextBox searchValue = (TextBox)Page.FindControl("searchValue");
if (searchValue != null)
Response.Write(searchValue.Text);
else Response.Write("Bad request");
}
But I have not been able to get it to work. Could you please show me how to fix this? thank you for your helps!
-Hai
Hai
modified on Friday, July 4, 2008 1:26 AM
|
|
|
|
|
Did you add the control to the page by using something like below
<br />
<uc9:controlbookdetail id="ID1" runat="server" properties....="" xmlns:uc9="#unknown" /><br />
nguyenhh wrote: protected void btnSearch_Click(object sender, EventArgs e)
{
TextBox searchValue = (TextBox)Page.FindControl("searchValue");
Control searchType = Page.FindControl("searchType"); //never find this control
if (searchValue != null)
Response.Write(searchValue.Text);
else Response.Write("Bad request");
}
This is not the way of using it.
You should write some properties to your control, So that you can directly use your control properties. No need to find each control inside it.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Sherin Iranimose,
I am learning .net, could you give me some example code to do this the correct way.
my web form file:
<%@ Import NameSpace="com.nangmoi" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Web" %>
<%@ Page Language="C#" MasterPageFile="~/MasterPageHome.master" Title="www.nangmoi.com" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register src="Control/ControlFormBookSearch.ascx" tagname="ControlFormBookSearch" tagprefix="uc6" %>
<script runat="server">
private BookManager objManager = new BookManager();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack){
GridView1.DataSource = objManager.getAuthorByAll();
GridView1.DataBind();
}
}
protected void btnSearch_Click(object sender, EventArgs e)
{
TextBox searchValue = (TextBox)ControlFormBookSearch1.FindControl("searchValue");
if (searchValue != null)
Response.Write(searchValue.Text);
else Response.Write("Bad request");
}
</script>
<uc6:ControlFormBookSearch ID="ControlFormBookSearch1" runat="server" />
user control page
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlFormBookSearch.ascx.cs" Inherits="Control_ControlFormBookSearch" %>
<table style="padding:0; border:solid 0px;">
<tr valign="middle">
<td style="vertical-align:top;border-bottom:solid 0px">
Keyword: <asp:TextBox ID="searchValue" runat="server" value="test" />
</td>
</tr>
</table>
user control code behind:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class Control_ControlFormBookSearch : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
public SearchValue{
get {return searchValue.Text;}
set (searchValue.Text = value;}
}
}
Thanks!
Hai
|
|
|
|
|
This is sample userctrl with textbox inside:
<![CDATA[<%@ Control Language="C#" AutoEventWireup="true" CodeFile="usc1.ascx.cs" Inherits="UI_usc1" %>]]>
<asp:panel id="Panel1" runat="server" xmlns:asp="#unknown">
<asp:textbox id="TextBox1" runat="server"></asp:textbox>
</asp:panel>
This is aspx page i include the user ctrl in this page, i use findcontrol method of usercontrol object, by using this u can find controls inside the usercontrols.
<![CDATA[<%@ Page Language="C#" %>]]>
<![CDATA[
<script runat="server">
protected void btn_Click(object sender, EventArgs e)
{
((TextBox)usrctrl1.FindControl("TextBox1")).Text = "adasd";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<samplectrl:communication id="usrctrl1" runat="server" xmlns:samplectrl="#unknown" />
<asp:button id="btn" runat="server" text="click find and write" onclick="btn_Click" xmlns:asp="#unknown" />
</div>
</form>
</body>
</html>
|
|
|
|
|
viivekk,
Thank you for pointing that out, what I was missing is:
instead of using:
TextBox searchValue = (TextBox)Page.FindControl("searchValue");
I should use:
TextBox searchValue = (TextBox)ControlFormBookSearch1.FindControl("searchValue");
as ControlFormBookSearch1 is the control id i used in my code.
Thanks again.
Hai
|
|
|
|
|
Hi
am trying to avoid sql injection.
i want to check only the input provided by the user and not the
viewstate how to avoid checking the view state .
the code i used is below
public static string[] checklist=
{"@@","declare","delete","drop","fetch","fetch_status",
"sys","sysobjects","syscolumns","execute", "update","truncate"};
void app_BeginRequest(object sender, EventArgs e)
{
HttpRequest Request = (sender as HttpApplication).Context.Request;
foreach (string key in Request.QueryString)
CheckInputform(Request.QueryString[key]);
foreach (string key in Request.Form)
CheckInputform(Request.Form[key]);
}
private void CheckInputform(string parameter)
{
for (int i = 0; i<checklist.length;> {
if ((parameter.IndexOf(checklist[i], StringComparison.OrdinalIgnoreCase) >= 0))
{
HttpContext.Current.Response.Redirect("~/Error.aspx");
}
}
}
Any help
ngrj.
|
|
|
|
|
Don't do it that way. Use parameterised queries (text or stored procs), or a decent data layer.
If you try to use a crappy hackish solution based on using a crap data access solution then expect complaints when Mr Joe Sysiman, or fetchdog69@hotmail.com wants to sign up for your services.
|
|
|
|