|
|
hi, In this sample, "Red" (polygon's Name) is displayed.
"http://stackoverflow.com/questions/32864627/google-maps-api-polygon-labels"
|
|
|
|
|
Need to compare a string with a list of strings condition space and case insensitive.
sample code :
public class COMProjectNameValidator:IValidator
{
MessageInfo _MessageInfo = new MessageInfo();
public void Validate(object obj, MessageList MessageList)
{
COMProjectDTO _COMProjectDTO=(COMProjectDTO)obj;
if (DAOUtil.IsValuePersisted(typeof(COMProjectEntity), "Id", _COMProjectDTO.COMProjectId) == false)
{
IGenericExtnDAO<COMProjectEntity> IGenericExtnCOMProjectLoadDAO = DAOFactory.Instance.GetGenericDAO<COMProjectEntity>();
List<COMProjectEntity> _COMProjectEntityList = IGenericExtnCOMProjectLoadDAO.FindAll().Where(t => t.COMBranch!= null && t.COMBranch.Id == _COMProjectDTO.COMBranchId).ToList();
}
else
{
IGenericExtnDAO<COMProjectEntity> IGenericExtnCOMProjectLoadDAO = DAOFactory.Instance.GetGenericDAO<COMProjectEntity>();
COMProjectEntity _COMProjectEntity = IGenericExtnCOMProjectLoadDAO.Get(_COMProjectDTO.COMProjectId);
if (_COMProjectEntity.ProjectName != _COMProjectDTO.ProjectName)
{
IGenericExtnDAO<COMProjectEntity> IGenericExtnCOMProjectLoadDAOForExist = DAOFactory.Instance.GetGenericDAO<COMProjectEntity>();
List<COMProjectEntity> _COMProjectEntityList = IGenericExtnCOMProjectLoadDAO.FindAll().Where(t => t.COMBranch!= null && t.COMBranch.Id == _COMProjectDTO.COMBranchId).ToList();
if (_COMProjectEntityList.Select(t => t.ProjectName).ToList().Contains(_COMProjectDTO.ProjectName))
{
MessageInfo _MessageInfo = new MessageInfo(KEYS.COM_Project_Name_ALREADY_EXIST, AlertMessageTypeEnum.Error);
MessageList.Add(_MessageInfo);
}
}
}
}
}
|
|
|
|
|
And your question is?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Bro, i wanna check a "name" is there in the db. i got a list of names from DB. Need to compare input name with that list of names.
if giving a name, that inside the list it will show a message already exist that name.
pbm is if the user don't know how the name is stored in db.
eg:list in the DB
Mathew Jacob
emil manrne
merlin antony
etc
input name : mathew jacob
white space there in between the name, front and end of name
if compare both will show message its existing oke
i think u got my Question
|
|
|
|
|
Member 11781455 wrote: i think u got my Question Yes, I already understood that; however, I am not going to write the code for you so I am wondering what you want from us.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
no need. I thought u don't get my pbm thats y i explained it. solved the pbm no issue thank u for u r time.
|
|
|
|
|
I think you solved it, but for future reference, please do not text people here. It is considered lazy and rude.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
can any one give clarity on this because i am fresher and searching for job
TextBox1.Text=dr[0].Tostring();
|
|
|
|
|
The Text field of the control named TextBox1 is being set to the value in item 0 of collection dr , whatever that happens to be. This is basic C# and you would be expected to have complete understanding of such basics in order to gain employment. I suggest taking a look at .NET Book Zero by Charles Petzold[^].
|
|
|
|
|
|
In 2 ajax calls that are listed below, there are 2 places that say 'error: AjaxFailed'.
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: document.location.pathname + "/GetStudentLetter",
data: "{ " + strData + " }",
dataType: "json",
success: function (data) {
LoadEditor(JSON.parse(data.d), milestone);
},
error: AjaxFailed
});
if (milestone == '999') {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: document.location.pathname + "/Gettattschyr",
data: "{ " + strData + " }",
dataType: "json",
success: function (data) {
successtest(eval(data));
},
error: AjaxFailed
});
}
}
function successtest(sletter) {
var sle = sletter
_txtattschyr = sletter.d
if (_txtattschyr > '1') {
alert('You have selected student(s) having more than one Entry for the current school year. ');
return
}
I would like to have better error handling so that I know what is exactly wrong. From the first ajax call, I got a 500 server error problem
in production. By guessing, I found out that I needed to increase the maximum size of the jason file that is posted above.
Thus can you tell and/or point me to urls that will show me better error logic that I can use?
|
|
|
|
|
You need to decide whether you want to be dcof or classy_dog, and remove the other account.
|
|
|
|
|
How do you remove the other account?
|
|
|
|
|
Login, go to your account page, select close account.
|
|
|
|
|
Have a look at the docs. The error function will be passed 3 arguments, and you can pas those to your callback determine the error type.
jQuery.ajax() | jQuery API Documentation[^]
You just need to rewrite your AjaxFailed function to accept those arguments, call AjaxFailed from a function() block, and pass the step where it failed through as well. You could even pass them as a parameter object for flexibility. Something like:
$.ajax({
...
error: function(xhr,type,text){
AjaxFailed({
errorType: type,
errorText: text,
target: 'Some descriptor of what step you were on...or something'
});
}
}
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Why do you do 2 ajax calls? Maybe I'm missing something, but should you handle the case of milestone being equal to 999 server side?
|
|
|
|
|
That sort of scenario is pretty common in an asynchronous architecture. You have substantially smaller packets, as you're not sending markup down the wire, but you tend to have more requests.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I don't think so.
Picture 100000 users hitting the webserver each twice instead of once each.
Why double the hits when you don't have to?
p.s i've been doing ajax w/ json since xml was the "de facto" standard for payloads... so - no - I totally disagree with your comment.
|
|
|
|
|
It's the way just about every RESTful interface that I've ever seen is designed.
Your disagreement doesn't change that fact.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
In a vb.net 2010 web form application, I have the start of code for a master page listed below:
#Region "Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_master = CType(Page.Master, MasterPage)
_master.PageTitle = "Attendance"
In the master page, there is an area to display error messages. When I have decided to place an
error message in the master page, I have made a call to a (static) shared function from an ajax call
to obtain data from the sql server database. The ajax call is made from a javascript function.
Thus can you tell me if there is away that I can access the error section of the of the master page?
Basically I need to have the master page with scope to access.
Thus can you tell me if this is possbile and/or show me the code on how to solve my problem?
|
|
|
|
|
One of us is confused here. I could of sworn that an AJAX call via JQuery using Webforms can only call a web service, and not just a shared function.
So either your page load is calling a shared function and generating the HTML needed to display on the master page, or you have a JQuery function that loads on DOM ready that calls a Web Service, in which it changes the DOM elements to reflect the HTML.
Either it done on the server side, and included in the HTTP request for the page.
Or it done on the client side, and it's done after the page load.
|
|
|
|
|
I am having a problem with an ajax call to a shared (static) vb.net function to obtain data from the database.
In a vb.net 2010 web form application, I needed to make a call from a javascript function to a shared (static) function to
obtain data from a sql server 2012 database. The first ajax call below is the original call and the second call is the one
I came up by copying the first call.
The problem is the first call always occurs before the second ajax call regardless of what I do with the code. There are cases when I
only want the second call to occur. By stepping through the code, I see that there is alot of jquery code that occurs.
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: document.location.pathname + "/GetStudentLetter",
data: "{ " + strData + " }",
dataType: "json",
success: function (data) {
LoadEditor(JSON.parse(data.d), milestone);
},
error: AjaxFailed
});
if (milestone == '999') {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: document.location.pathname + "/Gettattschyr",
data: "{ " + strData + " }",
dataType: "json",
success: function (data) {
successtest(eval(data));
},
error: AjaxFailed
});
}
}
function successtest(sletter) {
var sle = sletter
_txtattschyr = sletter.d
if (_txtattschyr > '1') {
alert('You have selected student(s) having more than one Entry for the current school year. ');
return
}
}
Thus would you tell me what you think is wrong and/or tell me how I can change the second ajax call to try to solve this issue?
|
|
|
|
|
You have to put the 2nd call inside the success of the firs call, or else the 2nd if statement will never have a value and run before the LoadEditor runs
|
|
|
|
|
I have 2 date picker in aspx page one normal date picker and one in gridview controller. fist one fromdate and second one Todate. Fromdate can't be less than todays date. and ToDates should be greater than or equal to fromdate.both are mandatory fields.First you have to select fromdate and secondary Todate both are depend on each other. you can change date picker value any time so if u select Todate u r able to change Fromdate any time. If you do so the contition will brake. u can give new date that greater than TOdate. so need to check 3 conditions
1. fromdate should be more than todays date
2. Todate greater than or equal to Fromdate
3.after select Todate . Fromdate can't give greater than Todate.
i have to do validation check on aspx page itself using javascript please help me ..
|
|
|
|