|
Though you have not shared much on what were you trying to do and what the XML looks like, based on the stack trace it looks like there is duplicate nodes name.
Here:
Anuradhaanu wrote: Types 'WebApplication1.Javawebservice.string' and 'WebApplication1.Javawebservice.string1' both use the XML type name, 'string'
Read all about it here: MSDN: Deserialization Problems Caused by Duplicate Node Names[^]
Find the duplicate class and remove it. Similar thing happened[^] with him and he too removed the duplicate.
|
|
|
|
|
Good Day Guys
This is an MVC , JQuery, KNockout.js Question.
i have a Controller Action that is being Defined like this
[HttpGet]
public JsonResult SearchCars(string searchString)
{
string[] searchTerms = (searchString).ToUpper().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
string[] searchTermSounds = new string[searchTerms.Length];
var list = (from r in Cache.CarSearchItems
select new Lightstone.UI.Web.LaceWebUI.Models.CarItem(r, searchTerms, searchTermSounds)).ToList();
var list1 = list.Distinct()
.Take(5)
.OrderByDescending(l => l.Hits).ToList();
return Json(list1, JsonRequestBehavior.AllowGet);
}
and i have a Jquery function that gets fired onkey up event is fired in a textbox like this
$(function () {
$("#txtSearchString").keyup(function () {
$("#txtSearchString").queue(function
() {
var _this = $(this);
_this.addClass("newcolor");
_this.dequeue();
});
if ($("#txtSearchString").val().length >= 3) {
var data = {}
data.searchString = $("#txtSearchString").val();
alert("Retrieving Data");
$.getJSON("/Cars/SearchCars", data, function (result) {
var viewModel = null;
viewModel =
{
SearchOptions: ko.observableArray(result)
}
alert("Done Retrieving Data");
if (viewModel == null || viewModel == undefined) {
alert("The ViewModel is null or Undefined");
alert("Done with the View Model");
}
else {
ko.applyBindings(viewModel);
alert("THe View Model is no Null");
}
});
}
})
});
dont mind my alerts i use them to check the code reaches the place that i want it to reach. I can get the Jason the first time and this is the order of my alerts
alert("Retrieving Data");
alert("Done Retrieving Data");
alert("THe View Model is no Null");
and then i bind the data to my HTML view as depicted below
<table id="tblsearchresults" data-bind="foreach:SearchOptions" class="auto-style1">
<tr>
<td rowspan="5">
<img data-bind="attr: {src: Url}" class="" />
</td>
<td>Make:</td>
<td>
<div data-bind="text: Make">
</div>
</td>
<td> </td>
</tr>
<tr>
<td>Model:</td>
<td>
<div data-bind="text: Model">
</div>
</td>
<td> </td>
</tr>
<tr>
<td>Year:</td>
<td>
<div data-bind="text: Year">
</div>
</td>
<td> <a data-bind="attr: { href: UrlRedirect }">
View Report</a>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
and i see the data when i search for the first time and the images appears nicely and then the Problem start when i change my search string lets say i now type "FORD"
<input id="txtSearchString" name="txtSearchString" class="searchText" />
and it does not return results, when i look at the F12 debugging tool in chrome it point to my JavaScript in the following line
ko.applyBindings(viewModel);
and in my
Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 knockout-2.1.0.js:46
a.e.Fa knockout-2.1.0.js:46
a.a.Oa knockout-2.1.0.js:81
a.Fb.a.h.disposeWhenNodeIsRemoved knockout-2.1.0.js:75
e knockout-2.1.0.js:34
a.h knockout-2.1.0.js:36
a.Fb knockout-2.1.0.js:75
a.c.template.update knockout-2.1.0.js:76
a.c.foreach.update knockout-2.1.0.js:66
a.h.disposeWhenNodeIsRemoved knockout-2.1.0.js:51
e knockout-2.1.0.js:34
a.h knockout-2.1.0.js:36
d knockout-2.1.0.js:49
c knockout-2.1.0.js:49
b knockout-2.1.0.js:49
c knockout-2.1.0.js:49
b knockout-2.1.0.js:49
c knockout-2.1.0.js:49
b knockout-2.1.0.js:49
c knockout-2.1.0.js:49
b knockout-2.1.0.js:49
c knockout-2.1.0.js:49
b knockout-2.1.0.js:49
c knockout-2.1.0.js:49
a.xa knockout-2.1.0.js:52
(anonymous function) AutoCompleteResults.js:33
jQuery.Callbacks.fire jquery-1.7.2.js:1075
jQuery.Callbacks.self.fireWith jquery-1.7.2.js:1193
done jquery-1.7.2.js:7538
jQuery.ajaxTransport.send.callback jquery-1.7.2.js:8324
So everytime i do my search for the first time it works but for the second time it does not.
One other solution that i need is to delay the call of the keypress for 250 milliseconds.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
The Problem happens when Knockout tries to Bind the ViewModel to the same node multiple times. seting the viewmodel to null will not work , so to resolve this i explicidly binded the tablelement, and after that i clear the node before i bind a Viewmodel
ko.cleanNode(document.getElementById("tblsearchresults"));
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
java method
@WebMethod(operationName="security", action="WsAuthentication")
// @WebResult(name="answer")
public String security(@WebParam(header=true, mode=Mode.IN, name="user" ) String user, @WebParam(header=true, mode=Mode.IN, name="password") String password) {
WsAuthentication secure = new WsAuthentication(user, password);
if (user.equals("IDS")&& password.equals("YES"))
{
return "true";
}
else
{
return "false";
}
}
By adding the reference to .net client
Iam not able able to instantiate the service
Method WsAuthentication.security can not be reflected. Exception is raising , how to access the function or use the other functions in the web service. please help me.
|
|
|
|
|
Need help in writing a java soap web service with soap header.
.net client should pass the user name and password in soap header to java web service.
on authentication the function should be accessible to .net client.
How can I achieve this please help me.
|
|
|
|
|
Please do not post the same question in multiple forums. I have already responded this in the Java forum.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i want to know how to use tracing and when to use it , i want to know why it is found in visual studio ?
|
|
|
|
|
As mentioned in MSDN, Tracing: These are statements that are intended to help track the flow of control and state of the program as it’s executing.
Imagine running a debugger, stepping along through code and checking the values of key variables in the Watch window. Tracing statements are intended to replicate that experience in cases where you can’t attach a debugger. They should ideally provide enough context that you can see which path is taken at each control point in the application and sort of follow along in the code from reading the trace statements. Tracing is enabled when the TRACE preprocessor symbol is defined at compile time, and can be in both release and debug builds. (By default, Visual Studio defines TRACE in both debug and release builds, but you can of course change this.)
About how to use it, follow these: MSDN: Configuring Tracing[^]
Actually, all you want to know about tracing: MSDN: Tracing[^]
Also go through this MSDN Support article: MSDN Support: How to trace and debug in Visual C#[^]
|
|
|
|
|
Think Sandeep addressed the "how to" pretty well... as to why... well, because it works very well, I've found it particularly useful when troubleshooting bugs in multi-threaded applications. Subtle bugs are sometimes almost impossible to find with other methods (such as breakpoints), so tracing gives you the ability to add debug code that will be printed and can be analyzed after the fact (similar to a log file).
|
|
|
|
|
Good Day All
i have a Strange issue here using the knockout lib. i have setup the Javascript like this
$(function () {
$("#lstSearchOptions").change(function () {
var data = {}
data.id = $("#lstSearchOptions option:selected").val();
$.getJSON("/Cars/SearchDetails", data, function (result) {
var model = {
SearchOptionsR: ko.observableArray(result)
}
ko.applyBindings(model, document.getElementById("tblsearchresults"));
});
$("#lstSearchOptions").blur(function () {
$("#lstSearchOptions").hide("fast");
});
});
});
and my HTML is defined like this
<table class="ResultsStyle" id="tblsearchresults" data-bind="foreach:SearchOptionsR" >
<tr>
<td rowspan="2">
</td>
<td>
Make:<div data-bind="text: Make"></div> </td>
<td colspan="2" rowspan="2">
<a href="#">View Report </a>
</td>
</tr>
<tr>
<td>
Year: <div data-bind="text: Year"/></td>
</tr>
<tr>
<td> </td>
<td>
Model</td>
<td>
<div data-bind="text: Model"></div></td>
<td> </td>
</tr>
</table>
This code it is a partial view that is hosted and called like this
@Html.Partial("_Searchplain")
and the java-script are rendered on top of the Page Layout
@Styles.Render("~/Content/searchcss")
when running my Project i get the Following error
2
Uncaught Error: Unable to parse bindings.
Message: ReferenceError: SearchOptionsR is not defined;
Bindings value: foreach:SearchOptionsR
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
As far as I can tell REST is a methodology or an archecture. Is it a real tangable thing? I mean, can you look at a back-end code and determine if it is REST or not REST? How do you communicate with a WCF RESTful service? Are all WCF services RESTful?
|
|
|
|
|
when i m trying to upload image
in database
showing
System.Web.UI.WebControls.FileUpload
not path
i wanted to store image by image name
where is the problem
rizvan sivally
|
|
|
|
|
sheemap wrote: where is the problem Somewhere in your code.
|
|
|
|
|
sheemap wrote: showing
System.Web.UI.WebControls.FileUpload
not path
Whatever way you tried to extract the file path was incorrect. As such, you no more get the full file path, just the myFileUpload.FileName .
This is based on security reasons. Further, once file is uploaded, all you need to worry/know is where is file is uploaded - path of this location. This is defined by you and can be very easily stored in DB along with the filename to access later.
Go through this article to learn on how to do it:
MSDN: Uploading Files in ASP.NET 2.0[^]
MSDN: FileUpload Class[^]
|
|
|
|
|
We maintain our own network, servers and internet connection here at work, because we find the IT services department of our owning company are too slow and bogged down with policy for our needs. Still we still neede to be able to access their network on occasion (e.g. their intranet site). You'd think that would be straightforward - they just need to set our domain as 'trusted', surely with whatever restrictions and sandbagging they deem necessary. However, they aren't willing to countenance that for who knows what reason, so I'm looking for an alternative. Preferably the solution would not involve everyone having two logins - one for our network, and one for theirs. Especially since they expire their passwords more frequently than most people here need to log in to their network.
One approach we thought of would be for our IT guy to maintain a single account on their network we could all share through our intranet (which already uses network login authentication).
Is there anyway to create a link / session that would automatically use a (different) set of network credentials when accessing a given site? Preferably such that a given user doesn't have to know the login details? (i.e., something like USERABC / PSWD1234 logs on to our intranet, then clicks on a link / app / button which uses USERQRS / PSWD7890 to login to their network)
|
|
|
|
|
I need to preselect (highlight) first row on page load event and then on button click event move to the next row. So far I had no sucess, below is my code. What am I miss?
<script type="text/javascript" >
var currentRowId = 0;
function MarkRow(rowId) {
if (document.getElementById(rowId) == null)
return;
if (document.getElementById(currentRowId) != null)
document.getElementById(currentRowId).style.backgroundColor = '#ffffff';
currentRowId = rowId;
document.getElementById(rowId).style.backgroundColor = '#ff0000';
}
function SelectRow() {
if (event.keyCode == 40)
MarkRow(currentRowId + 1);
else if (event.keyCode == 38)
MarkRow(currentRowId - 1);
}
</script>....
<asp:GridView runat="server" ID="GridView1" AtoGenerateColumns="True" >
</asp:GridView>
<asp:Button runat="server" ID="ss" Text="Click Me"/>
PageLoad
With GridView1
.DataSource = myDataSet
.DataBind()
.SelectedIndex = 0
.Focus()
.Rows(0).RowState = DataControlRowState.Selected
End With
Protected Sub GridView1
_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow And ( _
e.Row.RowState = DataControlRowState.Alternate Or e.Row.RowState = DataControlRowState.Normal) Then
e.Row.Attributes.Add("id", ndx.ToString)
e.Row.Attributes.Add("onKeyDown", "SelectRow();")
e.Row.Attributes.Add("onClick", "MarkRow(" + ndx.ToString + ");")
ndx += 1
End If
End Sub
Private Sub ss_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ss.Click
Dim i As Integer = GridView1.SelectedIndex
GridView1.SelectedIndex = i + 1
GridView1.Focus()
End Sub
|
|
|
|
|
hi,
Iam using bellow function to download files but files are not extracting after download .
function zipFilesAndDownload($file_names,$archive_file_name,$file_path)
{
$zip = new ZipArchive();
//create the file and throw the error if unsuccessful
if ($zip->open($archive_file_name, ZIPARCHIVE::CREATE )!==TRUE) {
exit("cannot open <$archive_file_name>\n");
}
//add each files of $file_name array to archive
foreach($file_names as $files)
{
$zip->addFile($file_path.$files,$files);
echo $file_path.$files,$files."<br>";
}
$zip->close();
//then send the headers to foce download the zip file
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=$archive_file_name");
header("Pragma: no-cache");
header("Expires: 0");
readfile("$archive_file_name");
exit;
}
any one can help to me..
Thank u
-- modified 16-Jul-12 9:37am.
|
|
|
|
|
Hi.
This issue has bothered me for some time now.
I have quite a normal website, with different html files. If I make changes to a file, I can (sometimes!) see the changes when I hit f5. But if the file is fully replaced (same name and extension though), my browser shows the previous cached page.
So I have to manually right click in the frame, and reload it to see the new version of the page.
After many times googling to address this issue, Ive come up with these meta tages in top of each page:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv='pragma' content='no-cache'>
But little does it help.
The problem is still there. Why? And how to solve it?
I´ve inspected of other sites that updates several times a day. They have have no special meta tags or alike in their html pages. And it´s of course not nescasary to update the page manually.
Is it a server side setting or what figures?
Thanks alot for your time
|
|
|
|
|
This is not a serverside issue, cache control is arranged by the client. If the client suspects the content to be out of date the browser will sent a head request. The server then replies with status 200 if there is a new version.
To disable caching on the browser you can set the following 2 headers:
<br />
Cache-Control: no-cache, must-revalidate<br />
Expires: Sat, 26 Jul 1997 05:00:00 GMT<br />
This should disable browser cache.
|
|
|
|
|
Alright, so that would be like:
and
Right?
|
|
|
|
|
|
Thanks alot, I´ll give it a try
|
|
|
|
|
Hi again.
I´ve tried what you suggested, but I has no effect. The problem is the same
Any idea?
|
|
|
|
|
I've written my first jQuery ajax function. It passes a date from the browser to a webmethod in my code-behind. From there the date is verified using a regular expression to make sure someone isn't trying to send something else back. Now, when I tested out this function before with a standard postback, it worked fine. Now, since I'm using ajax I'm getting the message back that my date is invalid, even though I can return it to the screen and it looks just fine.
My question is, how is the string formatted when it is sent from the browser to the code behind using ajax/json? Do I need to parse the date in my code behind?
|
|
|
|
|
You need to explain what framework you're using. In MVC, you can create a function that takes a DateTime of the same name, and the framework just magically parses it for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|