|
main diff..
Interface-all the methods should be a abstract...
abstractclass-it have normal method and or abstract method......
pain gives gain
|
|
|
|
|
Read How to get an answer to your question
only two letters away from being an asset
|
|
|
|
|
<asp:hyperlink id="Hyperlink1" runat="server" Font-Names="Arial" ForeColor="DarkSlateGray" Width="48px"
BorderStyle="Outset" Height="18px" BorderColor="ActiveCaptionText" BackColor="ScrollBar"
NavigateUrl='<%# "FrmTempEmployeeEdit.aspx?Code=" + Eval(Server.UrlEncode("ddlcontractor.selecteditem.value").ToString()) %>'
BorderWidth="1px" Font-Bold="True">Edit</asp:hyperlink>
Hi i am trying to pass one value using hyperlink
In that i am getting compilation error...,
Name Eval is not declared like...,
Plz any one solve this probs,
Regards,
Magi
|
|
|
|
|
If I'm not mistaken then Eval can only be used within GridView, Repeater, DataGrid, ... and not in a Hyperlink.
1) try to simply remove the Eval, if this doesn't work ...
2) Call a method on your code behind code that will return the string you need:
'<%# "FrmTempEmployeeEdit.aspx?Code=" + MyMethod("ddlcontractor.selecteditem.value") %>'
in code behind
protected string MyMethod(string s)
{
return Server.UrlEncode(s);
}
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
hello,
im creating a project for my studies and i want to know how is it possisble to add more controls like CAPTCHA , avatar url to the asp.net membership provider and what are the needs i have to do in order to achive these
aneef
|
|
|
|
|
I have a linkbutton(with enable=false) in a page.
I want to make it's enable true in another page.
how can I do this?
|
|
|
|
|
If you enable that true in another page how will it help?
The user cant see as he is in a different page and the lnkbtn is in a different page!
What is you requirement?
gauthee
|
|
|
|
|
see
1) change linkbutton access specifier to public 2) go to another page(where u want to enble), create a instance of first page & set its Enabled property to true
hope it will works
regards
GV Ramana
|
|
|
|
|
My object-orientation heart breaks when I read something like that.
Don't do something like that, it is very ugly, not maintainable, not extensible, error prone, ...
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Good Morning,
Friends, This is first time that I haven't got any reply of my post even after 26 hours nomally I get within one hour. My question could be tricky but not lengthy (I think) so here I am repeating my question again. I hope I will get answer this time. Please. It is urgent.
I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox. I need to fix this problem in firefox. Please tell me solution how can I call a webservice using javascript in Mozilla Firefox browser? Please.
Kind Regards,
Abubakar
|
|
|
|
|
Hi Abubakar,
The question comes up again and again, but nowhere in the web seems to be the correct answer (although I describe it in my German JavaScript book since quite some time). The topic is using JavaScript to call Web Services from within Mozilla type browsers. Whereas this is quite well-documented and works more or less seamlessly with PHP Web Services, .NET Web Services are problematic. Calling the Web Service works, as does parsing the return data. However, on the server end, only empty parameters arrive.
The trick is to manually set the type for the parameters you are sending to the server. So after creating a parameter:
var p = new SOAPParameter(value, name);
Then, you load the correct type; in this case, I am using string, but you could use other schema types like integer, as well:
var enc = new SOAPEncoding();
enc = senc.getAssociatedEncoding(
"http://schemas.xmlsoap.org/soap/encoding/",
false);
var coll = enc.schemaCollection;
var type = coll.getType(
"string",
"http://www.microsoft.com");
Finally, you link the type to the parameter:
p.schemaType = type;
And that's it! The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done.
By the way: When using the Atlas framework, you do not need this browser-specific code any more; calling .NET Web Services works in a browser-agnostic fashion here.
SSK.
|
|
|
|
|
HI,
Thanks for this article, I have already seen this article and tried as well. It gives me error on very first line.
var p = new SOAPParameter(value, name);
I think browser doesn't recognise this. I neither understand this line, It will be really nice if you explain this little bit more or give a short example;
"The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done."
Regards,
Abubakar
|
|
|
|
|
Abubakarsb wrote: I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox.
As I told you, *.htc doesnt work on non-IE browsers.
Abubakarsb wrote: lease tell me solution how can I call a webservice using javascript in Mozilla Firefox browser?
Okay. you can call a webservice by using XMLHttpRequest Object..
Example ~
var req;<br />
var isIE;<br />
<br />
function initRequest(url) {<br />
if (window.XMLHttpRequest) {<br />
req = new XMLHttpRequest();<br />
} else if (window.ActiveXObject) {<br />
isIE = true;<br />
req = new ActiveXObject("Microsoft.XMLHTTP");<br />
}<br />
}<br />
<br />
<br />
function CallWebService(url) {<br />
<br />
initRequest(url);<br />
<br />
req.onreadystatechange = processRequest;<br />
req.open("POST", url, true); <br />
req.setRequestHeader("Content-Type", "text/xml");<br />
req.send(null);<br />
}<br />
<br />
function processRequest() {<br />
if (req.readyState == 4) {<br />
if (req.status == 200) { <br />
var message = req.responseXML;
}<br />
}<br />
}<br />
<br />
Note:
#1. The parameter called "url" of "CallWebService" method is the URL of Web Service.
#2. You should use "POST" if you wanna invoke the .NET Web Service. AFAIK, the .NET Web service used "HTTP POST" by default. If you wanna use "HTTP GET", you have to change the setting in Web.Config.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Thanks a lot for brief reply Michael, I checked it, this is so far so good. There is no javascript error which is great. Now I want to call a "WebMethod" named "testWebService" from my webservice and want to pass and get some values from "testWebService". How is it possible? Plz.
|
|
|
|
|
Javascript (How to call .NET Web Service from pure javascript)
var req;
var isIE;
function initRequest() {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
isIE = true;
req = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function CallWebService(url,params) {
initRequest();
req.onreadystatechange = processRequest;
req.open("POST", url, true);
if(params!=null)req.setRequestHeader("Content-length", params.length);
req.setRequestHeader("Connection", "close");
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
function processRequest() {
if (req.readyState == 4) {
if (req.status == 200) {
var message = req.responseXML;
}
}
}
HTML (How to call Javascript function )
<input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService1',null)" />
<br //>
<input type="button" value="Call .NET Web Service with parameters!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService2','a=Michael&b=5')" //>
Web Service
using System;<br />
using System.Web;<br />
using System.Collections;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
<br />
<br />
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
public WebService () {<br />
<br />
}<br />
<br />
[WebMethod]<br />
public string testWebService2(string a,int b) {<br />
return "Hello World " + a + " - " + b.ToString();<br />
}<br />
<br />
[WebMethod]<br />
public string testWebService1()<br />
{<br />
return "Hello World ";<br />
}<br />
<br />
}<br />
<br />
Hope it helps.. If it is helpful for you, please vote the message. Thanks.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Note: Even though I'm sure that it can be done with pure Javascript, it is toooo much work to do if your project is big. So, I would like to suggest you to try some Ajax frameworks (ASP.NET Ajax)or Javascrpt framework (Prototype javascript library)....
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi Friend,
I just checked one thing, In following code I am getting status value 500 but not 200 which is require. so what could be wrong?
function processRequest()
{
if (req.readyState == 4)
{
alert(req.status);
}
}
|
|
|
|
|
You can use "statusText" to know what problem is.
eg:
alert("Problem: " + req.statusText);
Internal Error 500
The server encountered an unexpected condition which prevented it from fulfilling the request.
I would like to suggest you one thing. It is better if you try this in new project.
#1. Create Web Project (C#)
#2. Add Web Service item to your web project.
#3. Paste Web Service Code that I gave you.
#4. Rebuild the application and test whether your web service is working fine or not.. (If you don't know know how to test the web service, I will tell you one simple way. Click "Add Web Reference" and find the web service. If you found the correct web service, click to this link. it will show two functions (testwebservice1 and testwebservice2). then, click on this link and type some data and click "Invoke" button. )
#5. If those steps above are working fine, paste the javascript code to your aspx page. and paste the HTML code.
#6. Check the url whether it is correct or not. (the url from sample might not be matched with the actual URL of your project)
#7. then, try to invoke the function which has no parameter first.... if it is working fine, try another function with argument...
if you are still getting the error, let me know which step you got error... The code that I gave you has been tested with Visual Studio 2005 on Windows XP. It is working fine. Please try first with my code without modifying anything... if it works then you can carry on with your code....
3
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I tried same way as u said even with your code and I created a new project as well. It is really strange. I am using following statement. It works perfectly in IE6 and IE7 as well but unfortunately not in Firefox which I really need. Also tell me how can I get value from that specific xml tag but this is next step.
function processRequest()
{
if (req.readyState == 4)
{
if (req.status == 200)
{
var message = req.responseXML; //Result in XML.
alert(message.xml);
}
}
}
|
|
|
|
|
OH, Brother It is working now in Firefox as well. This is great. Let me have some more tests tomorrow with my webservice then I will post final in the forum. Meanwhile If I have poblem I will come to you again please don't mind. In the end, I just want to say U a lot of THANKS for your time and nice replys. You don't know how much you help me. GOD ALWAYS BLESS U and KEEP U HAPPY.
See U Tomorrow then, Have a nice Evening.
Bye
Abubakar
|
|
|
|
|
Sorry Brother I got little bit more excited. I am having this error message when I tried to use my code.
"Problem:Internal Server Error"
Do u know what could be reason? My webservice exists at following address and I am calling this from the same location. Here is code.
<input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')" />
Any Idea? Please suggest.
Thanks.
Abubakar
|
|
|
|
|
Abubakarsb wrote: http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')"
The HTML file (or aspx) and Webservice are in same domain?? I mean, if your web service is in http://192.114.169.164 then the HTML or aspx which invoke the webservice should be in http://192.114.169.164 too.. Thats mean you should be able to access like http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService and http://192.114.169.164/myAjaxPage.aspx.
Because it is not allowed to invode the Cross-sites by using XMLHttpRequest object..
(I have a problem in explaining things to other people. I don't know how to say/write clearly. )
So, put the test file in same place where your web service is stored and try to test againn...
btw, Have you tested your web service thought "web reference" dialog (as I mentioned in last thread)? I hope your webservice is working fine.
Good Luck.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Friend,
I put the project online. I put the same code in it which you sent me. You can also check urself, it is not returning right status. It is behaving dramatically different in IE and Firefox. In IE it is returning status value 500 while 411 in Firefox. I request you to check it in both IE and Firefox. In following file I am calling websevice by name only without full URL as both files (Webservice and .aspx file) exist in same folder.
http://192.114.169.164/Customers/NL/testWebservice/Default.aspx[^]
And in the following page I am calling webservice through full URL path with IP etc.
http://192.114.169.164/Customers/NL/testWebservice/testWebService.aspx[^]
One thing more both these files work perfectly on local computer but not on internet. Please check both links and tell me where I am doing wrong. Plz.
|
|
|
|
|
I have checked your webservice file.
http://192.114.169.164/Customers/NL/testWebservice/WebService.asmx
Your web service file is not working properly. It is giving me the errors. So, I suggest you to check your web service to make error clean.
When we are accessing the webservice url, it should give the list of functions available in that service... now, your webservice file is returning the error.... so, Please fix this webservice file first..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
I used a new webservice now
http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx[^]
and this is working really good in all the browsers. Today at night I will implement my real code and I hope it will work there as well. If not I will bother u again (Don't mind). If it works I will post its soution in the forums as well. Thanks a lot for your consistent help. GOD BLESS U.
Bye
|
|
|
|
|