|
DeanCook wrote: Rude!
you mean this?
DeanCook wrote: Will you both stop using my post to chat crap please.
Yes it was.
led mike
|
|
|
|
|
I believe i have found a solution to my problem, quote me if im wrong, but if i convert my web app to a winform app, it should be alot simpler to convert into a console app. logic is sound not sure about the method of it all, ill keep ya posted.
|
|
|
|
|
I have a textbox inside a usercontrol that is part of a modal window. I would like to set the focus to that control once the modal window is displayed. I have tried calling the controls focus() method. I have also tried adding script. It is just not working.
this.mpe.Show();
this.EmployeeNumber1.resetControl();
this.Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "money", "document.getElementById('" + this.EmployeeNumber1.TextBoxEmployeeNumber.ClientID + "').focus();", true);
Any Ideas?
I didn't get any requirements for the signature
|
|
|
|
|
Try to use
TextBoxEmployeeNumber.UniqueID
instead of
TextBoxEmployeeNumber.ClientID
|
|
|
|
|
Still didn't work. This issue appears to be this.
the output renders my javascript but the modalpopupscript comes after my script and therefore the focus is reset to something else.
<script language="javascript"> document.getElementById('ctl00$EmployeeNumber1$txtEmployeeNumber').focus(); </script>
<script type="text/javascript">
(function() {var fn = function() {AjaxControlToolkit.ModalPopupBehavior.invokeViaServer('ctl00_mpe', true); Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.ModalPopupBehavior, {"PopupControlID":"ctl00_ModalPanel","dynamicServicePath":"/TankBookWeb/tanklist.aspx","id":"ctl00_mpe"}, null, null, $get("ctl00_btnX"));
});
</script>
I didn't get any requirements for the signature
|
|
|
|
|
How can I get rowindex in gridview
I have gridview with 2 template column one of them are dropdownlist and the secound field is label
when i select on the dropdownlist the value showed in the label in the secound field
i want to know the rowindex in gridview which i select the dropdownlist in it
i used this code
mygridview.SelectedRow.RowIndex;
and
this code also
gvProfessions.SelectedIndex;
but it not work it return to me -1
please help me
Kareem Elhosseny
|
|
|
|
|
see my answer in the other thread.
|
|
|
|
|
That answer would solve mine (Gridview check box event handling in javascript) also...though I am using a datagrid and he is using a table....situation is same
Can somebody answer any of these
Sorry for making another post for the same question.
|
|
|
|
|
protected void Button1_Click(object sender, EventArgs e)
{
/* The code to send values to database */
/* AFTER SUCCESSFUL SENDING OF VALUES A JAVASCRIPT ALERT,
Mr. Abhijit's code which worked perfectly
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID,
"alert('Hello World');", true); */
/* Now when user click ok of alert box then redirect to home.aspx, HOW TO DO THIS? */
}
thanks in advance
|
|
|
|
|
If(alert.checked)
{
Response.Redirect("home.aspx")
}
Or put it in the event handler
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
windhopper wrote: If(alert.checked)
What is the 'alert' here?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
what is alert? how asp.net know what is alert.checked, how event handler work for javascript alert in asp.net.
|
|
|
|
|
replace
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, "alert('Hello World');", true);
with
Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, "alert('Hello World');document.location='home.aspx'", true);
|
|
|
|
|
THANK YOU TOOOOOOOOOOOOO VERY MUCH THANKS ALOTTTTTTT, CODE WORKED PERFECTLY
|
|
|
|
|
Hi! guys i'm using jquery to do some interesting interaction in a sms sending web application.from a textbox where the user should write the phone number(numbers are comma separated) after writing a comma the application extract that number and send it through jquery ajax function for number validity.so far everything is cool even though i know that my function extracting is not perfect(coz it becomes buggy when the first comma is pressed and then the number is edited if somebody fell to give better algorithm i would be pleased).the problem arises when collecting the response from the webform.the response which a boolean is actually sent with this Response.write(response).when i display it from an alert function is dispay something like
true
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1">
<div>
</div>
</form>
</body>
</html>
how do i extract actually the value true or false. my code is not seeing the true but always execute the statment in case it's false even though i have it true and displayed as described in my checkout alert function
here are my codes.
this is the one using the jquery
<br />
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableViewState="true" %>]]><br />
<br />
<![CDATA[<br />
<br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head runat="server"><br />
<link rel="Stylesheet" type="text/css" href="styles/txtBuddy.css" /><br />
<title>Untitled Page</title><br />
<script type="text/javascript" language="javascript" src="library/jquery-1.2.6.js"></script><br />
<br />
<style type="text/css"><br />
#vall { color: #0000FF; width:30px;float:left;margin-left: 10px} <br />
#err { color: #FF0000; width:30px;float:left;margin-left: 10px}<br />
</style><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<script type="text/javascript" language="javascript"><br />
$().ready(function(){<br />
var i = -1;<br />
$('#txtNumbers').keyup(function(e){ <br />
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;<br />
if(key== 188)<br />
{<br />
var y = $(this).val(); <br />
if(y.length!= 0 )<br />
{ <br />
var n = y.substring(i+1,y.lastIndexOf(','));<br />
i = y.lastIndexOf(",");<br />
alert("index " + i + " and value " + n);<br />
if(n != " " && n.length > 1)<br />
{<br />
$.ajax({<br />
type:"POST",<br />
url:"DestinationChecker.aspx",<br />
data:"number="+n,<br />
success:function(msg){<br />
if(msg=="true")<br />
{<br />
alert("true");<br />
alert(msg);<br />
$('#valid').append("<div id="vall">"+n+"</div>");<br />
}<br />
else <br />
{<br />
alert("false"); <br />
alert(msg);<br />
$('#valid').append("<div id="err">"+n+"</div>");<br />
}<br />
}<br />
});<br />
}<br />
else<br />
{<br />
alert("Please enter a number before the comma");<br />
}<br />
}<br />
}<br />
<br />
}); <br />
});<br />
</script><br />
<asp:panel id="container" runat="server" height="850px" style="z-index: 100; left: 25px;<br mode=" hold=" /> position: absolute; top: 38px" width="700px" bordercolor="Teal" borderstyle="Solid" xmlns:asp="#unknown"><br />
BorderWidth="0.5pt" CssClass="grandcontainer"><br />
<br />
<asp:textbox id="txtNumbers" runat="server" style="left: 47px; position: absolute;<br mode=" hold=" /> top: 284px; z-index: 103;"></asp:textbox><br />
<br />
<asp:button id="btnSend" runat="server" style="z-index: 109; left: 61px; position: absolute;<br mode=" hold=" /> top: 793px" text="Send Message" onclick="btnSend_Click" /><br />
<asp:button id="btnReset" runat="server" style="z-index: 110; left: 202px; position: absolute;<br mode=" hold=" /> top: 793px" text="Reset" usesubmitbehavior="False" /><br />
<br />
<asp:panel id="valid" runat="server" height="14px" style="z-index: 123; left: 273px;<br mode=" hold=" /> position: absolute; top: 625px;float:left" width="348px"><br />
</asp:panel><br />
</asp:panel><br />
</form><br />
</body><br />
</html><br />
and the called page code behing file
<br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Collections;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Text.RegularExpressions;<br />
<br />
public partial class DestinationChecker : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
string number = Request["number"];<br />
number = number.Trim();<br />
if(number.Length != 0)<br />
{<br />
bool res = this.checker(number);<br />
Response.Write(res);<br />
}<br />
}<br />
public bool checker(string testNumber)<br />
{<br />
Regex patterns = new Regex(@"^([1-9]{1}\d{8,15})$");<br />
Match m = patterns.Match(testNumber);<br />
return m.Success;<br />
}<br />
}<br />
<br />
PS:sorry for the appearance my code was a bit long so i was oblige to cut out some unnecessary lines for this topic
eager to learn
|
|
|
|
|
hello there! noone has something to share with me? a little help? need this help to move forward.thanks for replying.if a part is not clear just tell me and i'll be glad to explain.thanks
eager to learn
|
|
|
|
|
Using sql query its possible to find the last week dates?,
Mean Current date is 7/14/2008...,
So last week dates 7/7/2008 to 7/12/2008 have to come...,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Post it in SQL Forum
cheers,
Abhijit
|
|
|
|
|
|
I am learning a new way of setting up ASP .NET projects. So far, I've been using a structured approach as I am learning. However, now I am setting up projects using 3 layers, bl, dl, and dal. My question is, how would you databind a gridview going through all the layers? Any good examples? I couldn't really find any.
Thanks
|
|
|
|
|
You can create like this
BO [Business Object]
BLL [Business Logic Layer]
DAL [Data Access Layer]
Now First we define the BO
Here you can create some property according to need..
Now You can create your BO,BLL class objects into your UI code behind...
Now you assign the BO property
BO oBO=new BO;
myBLL oMyBLL=new myBLL();
oBO.PropertyName=ControlName.Text;
dataset ds=oMyBLL(BO oBO);
Now refer to you BLL
Create a class in you BLL folder which has the paratemer of BO
public dataset class myBAL(BO oBo)
{
}
and this BO class call the DAl like this
public dataset class myBAL(BO oBO)
{
return oDAL.YourSelectMethod(BO oBO)
}
Now DAL CLASS is like this
public dataset Class myDAL(BO oBO)
{
// Your Code for select is here
}
above is the secenirio That will be some error.. Hope you solve it into you level. Here I given only example
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hello Everyone,
I want to get the WebUsercontrol TextBox value in following issue.
1.Actually I Create a WebUserControl in my project there are several textboxes.
2.Then I create a MasterPage for Common ToolBar(For Insert,Update,Delete)for all UI page.
3. Now I Call the WebUserControl in my page.
4. Now I want to fill the text boxes from UserControl and click My Common ToolBar Insert Button.
5.But My page give the error Object reference not a set......
My Master Page Code sinpet is follows :
public delegate void ToolBarDelegate(object sender, EventArgs e);
public partial class ofcOpMasterPage : System.Web.UI.MasterPage
{
public event ToolBarDelegate AddEvent;
ToolBarDelegate AddFunction;
public event ToolBarDelegate InsertEvent;
ToolBarDelegate InsertFunction;
public event ToolBarDelegate DeleteEvent;
ToolBarDelegate DeleteFunction;
protected void Page_Load(object sender, EventArgs e)
{
AddFunction = AddEvent;
InsertFunction = InsertEvent;
DeleteFunction = DeleteEvent;
}
protected void ibtnAdd_Click(object sender, ImageClickEventArgs e)
{
if (AddFunction != null)
AddFunction(sender, e);
}
protected void ibtnInsert_Click(object sender, ImageClickEventArgs e)
{
if (InsertFunction != null)
InsertFunction(sender, e);
}
protected void ibtnDelete_Click(object sender, ImageClickEventArgs e)
{
if (DeleteFunction != null)
DeleteFunction(sender, e);
}
}
And Default Code Sinpet are
public partial class Default : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
PIInfoSoft.UI.OfficeOperation.ofcOpMasterPage objofcOpMasterPage = (PIInfoSoft.UI.OfficeOperation.ofcOpMasterPage)this.Master;
objofcOpMasterPage.InsertEvent += new ToolBarDelegate(objofcOpMasterPage_InsertEvent);
}
void objofcOpMasterPage_InsertEvent(object sender, EventArgs e)
{
PIInfoSoft.UI.UserControl.officeoperation.wucTourMaster objwucTourMaster = new PIInfoSoft.UI.UserControl.officeoperation.wucTourMaster();
objwucTourMaster.savedata();
}
}
}
and my WebUserControl sinpet is follows
public partial class wucTourMaster : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string aa
{
get { return this.txtTourCode.Text; }
}
public void savedata()
{
}
}
so can you suggest me how I insert the data through webcontrol in above secnerio after clicking the common toolbar Insert Button
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi all,
In my application I am using Response.TransmitFile to download a file on clients machine which, prompts the user where to save the file if the user clicks on save button. But I want to fix the location on clients system if he clicks on save button. Is it possible ? How do I meet this by any other means.
Thank U all,
Kiran
|
|
|
|
|
kadkir wrote: I want to fix the location on clients system if he clicks on save button.
How do you know what type of file system the client is using.
When you fix the location you give
Something like
C:\......
If C drive doesn't exist(If it is a unix system) what will happen?
kadkir wrote: Is it possible ?
The very first answer is NO
kadkir wrote: How do I meet this by any other means.
If you really want to do this, The answer is ActiveX controls.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Thank U Sherin,
Can any one suggest a site for free down-load of "File down-load activex control" which meets my requirement.
|
|
|
|