|
Thanks for above answer.One more question is that how I will know what links on the email sent the customer had clicked and how many time.
|
|
|
|
|
Niraj001 wrote: ent the customer had clicked and how many time.
This one is bit tricky
You Have to go for create a LinkId ..!
and in the body of the email give the LinkId for each link..!
Like
href=""YourPage.aspx"+"Id="+CustomerID"+"LinkID="+LinkID;
dependind upon the LinkId Query String You can Use..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi all,
i have a stored procedure :-
ALTER PROCEDURE dbo.BaselAnfouqa_CheckPassword
@UserID int,
@Password int,
@OldPassword int,
@NewPassword int,
@ConfirmPassword int
AS
Begin
if(@OldPassword <> @Password)
Begin
raiserror('Password does not match Original',16,1,)
return
End
End
UPDATE BaselAnfouqa_Clients
SET Password = @NewPassword
WHERE UserID=@UserID AND Password=@OldPassword
RETURN
and i want the raiserror to be shown in a label or something, anythoughts will be welcomed.
thx in advance
|
|
|
|
|
First of all this is ASP.NET Forum. You should asked this question in General Database Forum.
baselanfouqa wrote: i want the raiserror to be shown in a label or something
You can have a look into this
A Closer Look Inside RAISERROR - SQLServer 2005 [^]
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
i know there is a database, but alll of this in asp.net gridview
i want to validate password so that the user can enter new password but he cant do that if the original password does not match.
here is the problem, raiserror want it to show in any label if that is posible!!????
|
|
|
|
|
In your asp.net code put the call to the stored procedure in a try catch block, then use the catch to put the error on the screen - the raiserror will cause an exception in your code.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Nice I didn't know that, although this isn't really an error so I prefer to use Output parameters to send the info back to the client app.
|
|
|
|
|
ESTAN wrote: this isn't really an error
So don't use raiseerror, just return a value either as an outut parameter or simple single value select and use executescalar
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
You could use Output parameters to show messages.
An example:
CREATE PROCEDURE [dbo].[PN_ChangePassword]
(
@UserID int,
@Password int,
@OldPassword int,
@NewPassword int,
@ConfirmPassword int,
@Message varchar(255) OUTPUT,
)
AS
BEGIN
SET NOCOUNT ON;
IF(NOT @OldPassword = @Password) BEGIN
SELECT @Message = 'Password does not match Original'
END
ELSE BEGIN
UPDATE BaselAnfouqa_Clients
SET Password = @NewPassword
WHERE UserID=@UserID AND Password=@OldPassword
SELECT @Message = 'OK'
END
END
So if you execute this stored procedure from code you should gather the output parameters so you can use them.
|
|
|
|
|
thx that's exactly what i was looking for.
|
|
|
|
|
i want to make suggested textbox.but my code is not work.i have code like
'code of webservice.asmx
Public Function countryinfo(ByVal name As String) As String()
' Dim count As Integer = 10
Dim ct As String = "select name from XXXXX where name like '" & Replace(name, "'", "''") & "%' ORDER BY name asc"
Dim ds As DataSet = all result i put in dataset
Dim k As Integer = ds.Tables(0).Rows.Count
Dim items(k) As String
Dim dr As DataRow
Dim i As Integer = 0
For Each dr In ds.Tables(0).Rows
items.SetValue(dr("name").ToString(), i)
i = i + 1
Next
Return items
End Function
'html code for my test.aspx page
<cc1:autocompleteextender id="AutoCompleteExtender1" runat="server" minimumprefixlength="2" servicemethod="countryinfo" servicepath="WebService.asmx" targetcontrolid="TextBox1">
but its not display any suggested word or name from database.
plz provide me the soliution.
thanks
|
|
|
|
|
Put a breakpoint on the function in debug mode and try running your application, and see if the Web service is actually being called or not.
Also did you mention <WebMethod> attribute for your function countryinfo ?
|
|
|
|
|
<webmethod()>
Public Function countryinfo(ByVal name As String) As String()
' Dim count As Integer = 10
Dim ct As String = "select name from XXXXX where name like '" & Replace(name, "'", "''") & "%' ORDER BY name asc"
Dim ds As DataSet = all result i put in dataset
Dim k As Integer = ds.Tables(0).Rows.Count
Dim items(k) As String
Dim dr As DataRow
Dim i As Integer = 0
For Each dr In ds.Tables(0).Rows
items.SetValue(dr("name").ToString(), i)
i = i + 1
Next
Return items
End Function
i provide the break point but it dont call that function...wht to do now?
modified on Wednesday, December 16, 2009 4:34 AM
|
|
|
|
|
I have to validate 1 textbox and 1 FileUpload control on my page. I have make the user to fill at least one of them, i.e. both of them can not be left blank. Do anybody have any idea about how can use the CompareValidator for this.
Thank you.
|
|
|
|
|
anada8886 wrote: I have to validate 1 textbox and 1 FileUpload control on my page
Use customvalidator and javascript function..!
or use server side validation..!
anada8886 wrote: can use the CompareValidator for this.
why would you go for compare validator..!
Is it manadatory..?
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Thanks for the reply.
I have already tried using Custom validator with Javascript but it is giving me some JS error. And it is giving that error only for Custom validator,that is why I thought if it can be done using CompareValidator.
Secondly ,I want it in client side only,it should not go to server side.
|
|
|
|
|
anada8886 wrote: I thought if it can be done using CompareValidator.
the answer is no ..!You cant do it with comparevalidator..!
the compare validator checks if both the values are identical or not ..! thts it..!
<script language ="javascript" type ="text/javascript" >
function CheckEmpty() {
var fromaddress = document.getElementById('<%= TextBox1.ClientID %>').value;
var fromaddress1 = document.getElementById('<%= FileUpload1.ClientID %>').value;
if (fromaddress=="" && fromaddress1=="") {
alert("Should not be empty");
}
}
</script>
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:CustomValidator ID="CustomValidator1" runat="server"
ErrorMessage="should not be blank..!"
ClientValidationFunction="CheckEmpty"></asp:CustomValidator>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Thanks for your reply sir, but as I told you using CustomValidator is giving me error - 'Microsoft JScript runtime error: Object required',in the method WebForm_RemoveClassName(element, className) of WebResource.axd.
|
|
|
|
|
anada8886 wrote: Thanks for your reply sir
You no need to call any one as sir in here. ..!
then remove the custom validator..!and add the function for button click client validation..! as shown below..! Check OnClientClick="CheckEmpty();"
<asp:Button ID="Button1" runat="server" OnClientClick="CheckEmpty();" Text="Button" />
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hey thanks, it worked !!!
|
|
|
|
|
anada8886 wrote: Hey thanks, it worked !!!
Any Time..!
Here it is a tradition to mark it as answer if it helps..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Yes ,I know but I couldn't find any way here to mark your comment as 'Answer'.
|
|
|
|
|
Hi,
I am working on a Asp.net application. In this I have a gridview with autogenerate columns and data bind using linq in code behind. In this gridview I need to edit the cell on which I click. For example I have 5 columns in my gridview and I want to edit only 2,3,4 columns in the gridview and 1,5 columns are not editable.
If anyone have any idea to do this please reply me.
Thanks in advance.
|
|
|
|
|
Just Disabled the cell during GridView1_RowDataBound Event of GridView.
like
e.Row.Cells(3).Enabled = False
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|