PunkIsNotDead
Posts
-
Confirmation Message Box in Code Behind Asp.Net [modified] -
insert queryDo you mean, like using SCOPE_IDENTITY()? It stores the last inserted primary key value in the current context
DECLARE @Last_PK_Table1 AS INT
INSERT INTO Table1(field1, field2) VALUES ('Field1', 'Field2')
SET @Last_PK_Table1 = SCOPE_IDENTITY()
INSERT INTO Table2(Table1_PK, OtherField, OtherField2) VALUES (@Last_PK_Table1, 'field1', 'field testing')thankx
-
Upload file to server -
Search Control in GridView in asp.netHi! in future post, try using the code block :-D just for better understanding of the code :thumbsup: Well, the Control, must be a GridView, so you can add
public static Control FindControlRecursive(Control Root, string Id)
{
if (Root.ID == Id)
return ((GridView)Root);
if (Root is GridView)//or some like that (i don't remember well)
{
GridView gv = ((GridView)Root);
Int32 num = 3;//Based zero, number of column where is the link button column
Int32 row = 1;//Based zero, number of row where is the link button row
Control FoundCtl = ((Control)gv.Rows[row].Cells[num].FindControl(Id));
if (FoundCtl != null)
return FoundCtl;
}
return null;
}Remember that in ASP.NET the dinamically controls added like in grid view Template field, have the same name, except in Client-Side. if you want a especific row, you only need to change the row parameter ;)
-
How to loop through a ASP.Net Repeater using JQueryI didn't ask which language is here! but thanks :-D este ud ayudando o no, tampoco me interesa. Solo trato de responder la respuesta a la pregunta anterior, no busco nada mas! gracias
-
Auto Complete textboxTry using the auto complete with a web Method! adding up of the function
<WebMethod()>
Public Function blabla(ByVal prefixText As String, ByVal count As Integer) As List<String>
Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
Dim Qry = (From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m).Take(count)
Return Qry.ToList
End FunctionI don't remember 100% Vb but it may work :) good luck and don't forget the
ServiceMethod="blabla"
ServicePath="MyPage.aspx"in the Extender
-
How to loop through a ASP.Net Repeater using JQueryHi! I think that Mark Nischalke is only playing with you and he isn't seriously at all! Here[^] is a tutorial that I've made about jQuery, Web Methods and SQL Server Data Populating in Grid View... I hope you know a little of spanish :laugh: if not, just try to understand and apply to your web site. Looks like the same procedure but with some changes... hope it helps :laugh: ;)
-
ListView with itemtemplate- Highlight selected row -
Crystal Report in IE8Hi! I've a little problem! IE8 can open a Crystal Report document whenever you have added to thust sites. (tested here[^]). I only want to prevent this procedure and do something in IIS side or programatically cause the site I'm working is a public site and nobody likes read instructions or something like that! ;) If the user visit the site with IE8 the report won't show! any help? :confused:
-
How to pass username and password between sites?Hi! thanks for reply! Ok! that's a good alternative! I've read about it and it seems well! but I was wondering if there's a way to don't involve the url in the login process! Anyway it might be the best solution (if there isn't another better) Thanks Andreas X ;)
-
How to pass username and password between sites?Hi! I'm working in two sites! lets say that first is the public second the private one! in public site, we add a login form which redirects to the second site (in case the username and psw are correct). Now I want the user login in second site instead showing the login page (which are by default) My current problem is that sessions don't work between sites. And Query Strings are very unsecure in that way (any user writing the correct QS would login or psw would be seen in the url). How can I correct this little issue?? :confused:
-
display hyperlinkinstead use Panel1.Controls.Add(MyDiv); try using Panel1.Controls.AddAt(0, MyDiv); Where 0 is the position of the controls! ;)
-
usercontrol eventOk no problem! that's why we are here! ;)
-
send alert message from child ascx to the parent pagein ascx codebehind add
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("OnClick", "javascript:alert('your message');");
}:) try and tell us how it worked ;)
-
accessing textbox which is inside ascx fileHey what's up here? discuss your differences outside the forum ;) a property is very simple to learn! I have learned :laugh: have you searched in google?? I know nobody is perfect but when you have the opportunity to search something without posting, just search and don't mess with stressed people like us! ;) thanks :thumbsup:
-
usercontrol eventMaybe it is showing! all the code is correct! :confused: i'm sure that if you put a breakpoint, the d.MyValue is the textbox.Text of user control. I've copied the text you have written! and it works for me! that simple! Have you added the event in the aspx page??
<%--'This is how i have named my user control (TestUserControl)'--%>
< uc1:TestUserControl ID="UsrCtr_Test" runat="server"
OnResultOfMyText="ResultOfUserControlTextBox" / >to codebehind
//triggered by the event 'OnResultOfMyText="ResultOfUserControlTextBox"'
protected void ResultOfUserControlTextBox(object sender, ResponseEventArgs d)
{
Txt_MyTextBox.Text = d.MyValue;
}good luck! I hope you finish with this ;P ;P
-
usercontrol eventhave you create a class with name ResponseEventArgs.cs?? the content of that class should have
private String _myValue;
public String MyValue
{
get
{ return _myValue; }
set { _myValue = value; }
}}if you've created! then look where it is! for example, if I've created the class in a folder named "Classes", I have to reference it like Classes.ResponseEventArgs ;) Ahh and the first part is from the ResponseEventArgs.cs class! the other parts are from the ascx userControl. And in the aspx page you will see the event ResultOfMyText and when you've triggered, it would look like this
protected void ResultOfMyText(object sender, ResponseEventArgs d)
{
String response = d.MyValue;
}modified on Wednesday, May 19, 2010 4:28 PM
-
usercontrol eventOk! I know what you need! create a class (named ResponseEventArgs) that inherits the EventArgs and add a property named myValue. Like this
public class ResponseEventArgs : EventArgs
{
private String _myValue;
public String MyValue
{
get { return _myValue; }
set { _myValue = value; }
}
}Then in your ascx user control, add the event and the correct delegate
public delegate void ResponseEventHandler(object sender, ResponseEventArgs d);
public event ResponseEventHandler ResultOfMyText;
here you've added the event ResultOfMyText and the handler ResponseEventHandler. Now in the ascx user control add the event as a virtual function
[Description("Event that fires after button click of user control")]
protected virtual void OnResult_Show(ResponseEventArgs re)
{
if (ResultOfMyText != null)
ResultOfMyText(this, re);}
Now in button Click event of the user control, add the correct value to MyValue Property
//here is button_Click event of the user control
ResponseEventArgs re = new ResponseEventArgs();
re.MyValue = Txt_Value.Text;//You need a textbox named Txt_Value
OnResult_Show(re);then when you've added this user control, you'll see that it has a event named ResultOfMyText. Trigger that event, and you'll see that you have a d.MyValue in ResultEventArgs and will execute that event every time that you click on the button inside the user control. I hope this won't be confused ;)
-
usercontrol eventOk thanks mark! but that was the first thing that came to mi mind! I'll take and follow your suggestions! X|
-
usercontrol eventmmm! hard to understanding? let's say that you have an ascx page name Logo.ascx. Then when you add this ascx to a page named Test.aspx, your ascx User Control is named with ID="Logo1" in the Logo.ascx.cs add this:
//this is Logo.ascx
public string txt;
private string Text
{
get { return txt; }
set { txt = value; TextBox1.Text = value; }//You must have a TextBox named TextBox1
}and now you can call the public property of the ascx file! use this in Test.aspx or any page you've added the User Control
//and this is Test.aspx
protected void Page_Load(object sender, EventArgs e)
{//Once you have understand the property's world ^^ you can
Logo1.txt = "my text";//set the property value
TextBox2_GetText.Text = Logo1.txt;//or get it's value
};) good luck