|
I solved it(;-
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Up")
{
int i = int.Parse((string)e.CommandArgument);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i - 1].Values[0].ToString()), i + 1);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i].Values[0].ToString()), i);
BindData();
}
else if (e.CommandName == "Down")
{
int i = int.Parse((string)e.CommandArgument);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i + 1].Values[0].ToString()), i);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i].Values[0].ToString()), i + 1);
BindData();
}
}
|
|
|
|
|
Hi,
I want to do screen scraping i.e to get the data from a particular site after post back.
e.g
1)www.funjet.com
2)enter the origin and destination in the saerch criteria on the left
3) Get teh Avaibility page , and not to scrap the required data.
Need to perform the above operation through the code.
|
|
|
|
|
|
hi,
i want to use "System.DirectoryServices.AccountManagement" this dll.
The problem is that when i am trying to add this throug addreference that time this dll is disable.
Any solution how to enable this one.
|
|
|
|
|
The problem is that this is a 3.5 .NET dll.
If your asp.net website uses a lower .NET version, then all dlls you can't
add (because of the version) become gray and you can't add them.
Greetings
Covean
|
|
|
|
|
hii am using web service in my application.i added web refrence.now i am trying to use
it in my code.actually it is temperature conversion web service.
the code is:
Protected Sub ConvertButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click
Dim wsConvert As localhost.Convert()
Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text)
FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString()
End Sub
but i am not getting the function FahrenheitToCelsius()
plz guide me where am i wrong...
|
|
|
|
|
did you declare webmethod in webservice on the top of method..!
If yes Show your Webservice method full in code block..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
It'll be better if you post webservice code. Cheers!!
Brij
|
|
|
|
|
web service code:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Convert
Inherits System.Web.Services.WebService
<System.Web.Services.WebMethod()> _
Public Function FahrenheitToCelsius(ByVal Fahrenheit As Double) _
As Double
Return ((Fahrenheit - 32) * 5) / 9
End Function
<System.Web.Services.WebMethod()> _
Public Function CelsiusToFahrenheit(ByVal Celsius As Double) _
As Double
Return ((Celsius * 9) / 5) + 32
End Function
End Class
implementation code:
Partial Class Default4
Inherits System.Web.UI.Page
Protected Sub ConvertButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click
Dim wsConvert As localhost.Convert()
Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text)
FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString()
'wsConvert.FahrenheitToCelsius(temperature).ToString()
' CelciusLabel.Text = "Celsius To Fahrenheit = " & _
' wsConvert.CelsiusToFahrenheit(temperature).ToString()
End Sub
End Class
|
|
|
|
|
i got the solution...
jst changed the code line as:
Dim wsConvert As localhost.Convert()
to
Dim wsConvert As localhost.Convert = New localhost.Convert()
nyway thanks.....
|
|
|
|
|
good njoy Cheers!!
Brij
|
|
|
|
|
hello
actually i've developed a asp.net 2.0 multilanguage website by using localization incl. resource files.
now i've got a problem with the following question:
how can search engines detect my multilanguage website-content ?
can they detect the resource-files ?
thanks for any help
cheers
lutz
|
|
|
|
|
Hello Friends,
I've a GridView inside an Update Panel. There is a Select Command inside the GridView as i click on Select Link for a row. It has to fill the labels with the value brought at RowCommand for Select Command but labels are outside of the Update Panel so it's not showing the values in the labels. But if i use PostBack Trigger then it's working fine but taking an postback. So i want to use something for AsynPostBack. So suggest me the way
|
|
|
|
|
Hi there,
I was looking for a chat program, and I found it here in Code Project,
Build a Web based Chat using ASP.NET Ajax (http://www.codeproject.com/KB/ajax/aspnetchat.aspx)
The code is working perfectly,except 2 issues,can anybody tell me how can I overcome these issues?
1-how can I get for example the last 2 hours chat from the database, when a new user enters to the chat room? I tried the getlastmessage stored procedure, but because of the refresh, it keeps showing the messages over and over. any solutions?
2-In firefox after I hit the enter on keyboard I see two messages instead of one. sometimes it happens in IE too.
Thanks in advance
|
|
|
|
|
It'll be better if you put your question in the Article itself. Cheers!!
Brij
|
|
|
|
|
I've already put the question, but still no answer
|
|
|
|
|
Hi
I am using Gridview.In that I used text which is used as template field. I also use label in that template field. Now onchange event of each text box i want to visible my label. Onchange event I am passing text value for some checking. when I display using alert it showing that value. So How can I assign that value to label and show that label.
Because of label in template field I think its not working. I tried with test page without inserting label in itemtemplate gridview it showing exact result what i want that is showing text what I passed on to onchange event of textbox
So How can I Show the text using that label?
Thanks
sjs
|
|
|
|
|
You just need to have client ID of label.
First point, make the label's style.display='none' from server when you dont want ot display it.Pass the client id of the label on onchange event of each text box from server side itself.Now on onchange event you will be having the clientid of associated label just change the style as style.display='' .
Let me know if any query..Cheers!!
Brij
|
|
|
|
|
Hi,
If i passed labels clientid through on onChange event of Text then its not working.
my code is :-
<EditItemTemplate>
<asp:TextBox ID="txtEditPassword" runat="server" TextMode="Password" OnChange="Getlblvalue(this.value,<%=lblpwd.ClientID%>);" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ControlToValidate="txtEditPassword" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtEditPassword" Display="Dynamic" ErrorMessage="*"
ValidationExpression="([0-9,a-z,A-Z,*,@,$,-,+,?,^,_,&,=,!,%,(,),~,£,#,/,]){1,12}"></asp:RegularExpressionValidator>
<asp:Label ID="lblpwd" runat="server" ForeColor="Red" Visible ="true"></asp:Label>
</EditItemTemplate>
and my java script is:
<script language="javascript" type="text/javascript">
function Getlblvalue(str,lblid)
{
alert(lblid);
var gridViewCtlId = '<%=GVUserDataList.ClientID%>';
var grid = document.getElementById(gridViewCtlId);
var gridLength = grid.rows.length;
var sum = 0;
// //calculate sum of the prices looping through the gridview and operation in every cell
// grid.rows[5].cells[5].FindControl('lblpwd').textContent="Hello";
// sum = (grid.rows[5].cells[5].find.textContent);
// alert(grid.rows[5].cells[5].FindControl('lblpwd').textContent);
// //grid.rows[gridLength - 1].cells[5].innerHTML = sum;
}
</script>
Thanks
|
|
|
|
|
You have to attach the OnChange event to textbox at server side in grid's databound event.There you will get the client Id of label using find control.
First find the textbox and label in databound and attach the event like this at server side
txtEditPassword.Attributes.Add("onchange", "Getlblvalue(this.value('" + txtEditPassword.Text+ "','"+ lblpwd.ClientID+"');"); Cheers!!
Brij
|
|
|
|
|
ok Thanks for your help..I will try it..
Thanks Again..
|
|
|
|
|
your most welcome Cheers!!
Brij
|
|
|
|
|
hi
i worked on windows application and now i m working on web application for the first time.
the following is my code in defalut page
Partial Class _Default
Inherits System.Web.UI.Page
Dim i As Integer = 0
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
i = i + 1
MsgBox(i.ToString())
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
i = i * 100
MsgBox(i.ToString())
End Sub
End Class
when i click button1 the value in i is 1.
but when i click button2,it is showing the value in i is 0
but ihave to get 100
can any one tell me whats happening at button2
|
|
|
|
|
First, format your code using the pre tags when posting. You've been around long enough to know this.
Understand that the web, and ASP.NET, is stateless. Each time a page is requested, or an action, such as a button click, causes a postback, all the variables you have declared are set to their default values unless otherwise persisted.
You will do well to pick up a book on ASP.NET and read it before proceeding. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
vijaylumar wrote: Dim i As Integer = 0
you declared i as 0 so you get result as 0
|
|
|
|