15,896,118 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by SrikantSahu (Top 60 by date)
SrikantSahu
15-Aug-17 3:46am
View
Do you bring all the messages send to the user in each ajax call.. or its just the last message?
SrikantSahu
29-Jul-17 3:55am
View
try in console once(F12). see if $('#selectPage').val() gives any values.
Ideally when you are forming those buttons they all will have same ids.
And the change event handler, I am not sure.. did you think about a Select Item with a different Id?
SrikantSahu
29-Jul-17 3:48am
View
I checked the code.. and the ball is moving in circular. Not sure where is the problem, as it crosses the first cell where it was initialized.
SrikantSahu
29-Jul-17 3:45am
View
I dont think, you will be able to post a javascript variable to PHP , unless you put the varaiable value in some input or some other html controls. You can also do an ajax call where you can pass the variable as a json Key-pair value.
SrikantSahu
10-Apr-17 5:31am
View
Can you paste the full html code.
SrikantSahu
10-Apr-17 5:29am
View
This self.ioEvent, how you are binding them? Usually you should have the information about the sender in the event input parameter. I suggest, you log it and check the sender information and then you can prepare the data for the ajax call.
Normally, if the binding is correct $(this) represents the object which triggered the vent and you will get the value of $(this) inside the eventhandler.
SrikantSahu
6-Apr-17 9:38am
View
you have wrapped $('#formvalidation').validate() with init function with a closure. Is it necessary.
SrikantSahu
6-Apr-17 9:35am
View
Never seen such a long conversation to solve an issue. @Karthik, all the best
SrikantSahu
3-Apr-17 5:34am
View
I am not sure how you are planning to do it. Because the chorme extensions work on locally and what you are suggesting is running a php code to read the mysql data. To run php you need a server (Apache) and I dont think you will be able to integrate the server or parse the php file back to html and then show it.
My suggestion would be to keep details inside a json file and read the data using javascript and show them.
SrikantSahu
26-Mar-17 5:21am
View
I hope you need the position only after the postback. Because before the page is rendered to the client browser, you cannot get the position..
Assuming that you need the position in postback, you can use jQuery to get the position and then save it in the hidden field and read it in page_load...
Ex: $('#hdnfieldselector').Val($('#txt'). position().left)
SrikantSahu
26-Mar-17 5:12am
View
Yes, you can call another Ajax call for show2 in show1's success method
SrikantSahu
24-Mar-17 15:55pm
View
First fill in your href tags for all the links... Then in the event handlers for 'a' you can write the code..
Ex:
$('div ul li a').click( function (){
$('#div1').load($(this).attr('href'));
})
SrikantSahu
24-Mar-17 15:48pm
View
At what point this external js adds the newDiv.. is it after your document.ready?
You can keep the object in a global variable just before adding then use it where ever you like.
Ex: var obj = $(selector);
$(currDiv).Append(obj)
obj still exists here, you can use it and then clear the js variable..
But I m still wondering why can't you find the newDiv by it's selector (css class)
SrikantSahu
24-Mar-17 12:05pm
View
Web is not a right choice for this unless you want to host the web application in your local machine. This should be done by simple java/c# using desktop application.
Also if you want only the image names, you can right simple batch file with the dates as inputs and this could be done.
SrikantSahu
23-Mar-17 8:14am
View
do you want to open the image from the file dialog box. You can paste http://image.prntscr.com/image/c38d9631bb6d4853ba5853a40e2342e9.png in the textbox, it will open the file.. But I am wondering what is use here...
SrikantSahu
20-Mar-17 16:00pm
View
If it allows to take a picture, you can do a Ajax call to send the picture to a web service which can do the scanning and return the code. Just a thought.
SrikantSahu
20-Mar-17 15:57pm
View
Are you facing problem in jQuery?
$('#tabs').tabs('select', 1);
This should work.
Ideally you can load all your pages load when the main page loads or on change of tabs pull out the phone pages
SrikantSahu
20-Mar-17 15:50pm
View
Out of 3 click event handlers, where exactly you are facing issue.
SrikantSahu
20-Mar-17 1:26am
View
Only to the echo statement and not to the DB query.. so that the 'OK' along with date time can return to your Ajax call and from the Ajax success method you can read the date.
The msg will now contain 'ok##datetime' and it's a string, so you can split it with the ## separator. Hope this helps
SrikantSahu
20-Mar-17 0:59am
View
Any specific error you are getting? Can you edit the question with the updated code.
SrikantSahu
17-Mar-17 11:44am
View
I think from your php code, you can send the date as well along with status. Something like "ok##".date("Y-m-d H:i:s"). Then in the ajax success, you can split the msg
ex: msg.split('##')[0]=='ok'
Also, when you use jquery you can avoid plain old javascript for DOM manipulations.
ex: $(prevTr).append('Date Discontinued : '+ msg.split('##')[1])
SrikantSahu
17-Mar-17 11:21am
View
Just tried your code by entering 144001 and its showing the error in the alert. What is the issue here?
SrikantSahu
16-Mar-17 9:24am
View
Do you intend to push all the selected Projects one by one to the hidden field hdPremUserProject , when you click on the Add button?
SrikantSahu
16-Mar-17 8:03am
View
Please see my updated solution
SrikantSahu
16-Mar-17 6:15am
View
can you try
txtPhoneNumber[0].onkeydown = function(){alert(1);}
instead of the event handler
SrikantSahu
16-Mar-17 6:13am
View
Actually, you can. Have a global js field and get the country value there in the onload and use it in your js file.
SrikantSahu
16-Mar-17 6:09am
View
FullName is not an entity member(i.e. column name for the Person table), for this reason the query is not able to run. Can you try with LastName only. If that works then you can use <LastName + ", " + FirstMidName>
SrikantSahu
16-Mar-17 5:46am
View
Deleted
What have you tried looks good. I believe you want to pass on the parameters as well..
if (country == 'X') {
maxLength = '14';
phoneNumber = '963-';
txtPhoneNumber.on('keydown', function (e) { return HandlePhoneNumberX(e, maxLength, phoneNumber); });
}
else {
maxLength = '12';
phoneNumber = '961-';
txtPhoneNumber.on('keydown', function (e) { return HandlePhoneNumberY(e, maxLength, phoneNumber); });
}
SrikantSahu
29-Jan-17 9:20am
View
Glad it worked. :)
SrikantSahu
28-Jan-17 9:26am
View
I dont think you need var state = $(".selectpicker#state").val(); to pick the value...... Just var state = $("#state").val(); is sufficient to pick the value. You can log the values before posting or see the n/w tab in the chrome web developer tool; this will let you know whether the value is getting posted or not.
SrikantSahu
10-Jan-17 12:58pm
View
I just checked your site http://5.189.146.208/DM . I think the font-awesome bundle has loaded just fine. You can see the Chrome web developer (F12) -> SOurce (tab) -> top->5.***.***.**->font-awesome-> css?***. similarly the jquery bundles have also loaded.
SrikantSahu
10-Jan-17 10:03am
View
Are not you using ADO.net to connect to sql server? How can you insert data directly from javascript? You need to bring the data to a your backend code (C# in asp.net ) and then through ADO.net you can push records to sql server.
SrikantSahu
9-Jan-17 11:17am
View
Not sure if I understand your question properly. Do you want to send the last appended row data to the ACtionMethod or the whole grid data? In your logic the "Detail" you have taken as an object ideally it needs to be an Array such that when you are looping through "tr.detailclass", for each tr one value can be pushed to the Array (Detail)
SrikantSahu
9-Jan-17 11:00am
View
Just tried in a sample application. Both the @url.Action and bundle are working fine. Please recheck , how you have deployed the solution. Here is an link "http://www.c-sharpcorner.com/article/deploying-your-asp-net-mvc-5-app-to-iis-8/" .
SrikantSahu
6-Jan-17 15:33pm
View
You can try
$(" #nav li").hover(function () {
$(this).find('ul:first').show();
}
, function () {
$(this).find('ul:first').hide();
});
This should show the embedded ui element inside the '#nav li' when hovered and hide the ui when mouse out of the '#nav li'.
SrikantSahu
28-Nov-16 1:59am
View
Thanks Dave, this is working. You are right, there is no point in spawning a thread here, but I just wanted to try out the async with raw sql query. Just wanted to let you know that, putting an await before LoadDataAsync() and marking the page_load as async in my original solution also worked.
SrikantSahu
26-Feb-15 9:50am
View
Hi,
No need to stringify the Json object.
Just send the Json object directly, i.e. pass data1 to your $.post
Thanks
Sroikant
SrikantSahu
25-Jan-15 16:25pm
View
Please mention the datatype of mytv...
SrikantSahu
25-Jan-15 16:18pm
View
Hi,
Trim is a method , so it should be called by Trim().
TreeNode myChild = new TreeNode(System.Convert.ToString(mydt.Rows[j]["family"].ToString().Trim()));
Thx
SrikantSahu
23-Jan-15 5:15am
View
yes, you can create a proxy class for the WCF service.
SrikantSahu
18-Jan-15 13:39pm
View
Hi,
You need to put your table inside the form.
Thanks
SrikantSahu
14-Jan-15 13:09pm
View
you should change the input parameter to int? instead of int, this makes it nullable.
SrikantSahu
5-Dec-14 14:47pm
View
Updated the code to support MVC :)
SrikantSahu
5-Dec-14 13:21pm
View
Hi,
With MVC your job is lot easier,
Simply what you can do is, create an action method to return a JsonResult. While going through the loop just add the items to a List or dictionary object and return it from the action method.
Now that result can be consumed through an ajax call easily using Jquery.
or.
Create a partial view which returns only the LI part by following as below mentioned.
In the partial view you can bind the list read in the action method as a Model and using a foreach loop you can construct the LI.
Finally the partial view you can use it your view or in your layouts.
Thanks
SrikantSahu
4-Dec-14 14:12pm
View
When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.
Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true.
For more information, please visit http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx
SrikantSahu
4-Dec-14 13:56pm
View
Hi,
Actually for a normal dialog to load in a page jquery needs all the code to be already existing and downloaded. When a jquery dialog opens up it does not request new resources ( pages, .js, .css etc). What it actually does is some portion of your pages it displays with special properties ( Makes it modal, set gray back ground color, higher z-index) etc.
But if you really want to go with external files, best way would be to follow the below process
1) Create an html file lets say dialog.html
2) That html file should contain all your references to external files (.js & .css)
3) Now in your index page create a div and within that create an iframe.
4) Now set the src property of the iframe to your dialog.html.
5) Now the regular code to show up your dialog .
$('#dialogDiv').dialog({ .... });
6) This should be able to make your div show the iframe in a dialog mode.
7) Downloading the referenced files, iframe will do it for you.
Else you can have them in your index file as well.
Alternatively, you can also check $().load() method which actually fetches .html file. That .html file can be written in such a way to keep your contents of dialog. but here also the external scripts need to present in your index file only.
Thanks
Srikant
SrikantSahu
2-Dec-14 13:22pm
View
you welcome :)
SrikantSahu
2-Dec-14 13:22pm
View
Hi,
You can change this code in the following way..
function highlight(checkBox,row)
{
var color1 = "#CCCCCC", color2 ="";
row.style.backgroundColor = (checkBox.checked ? color1 : color2);
if(checkBox.checked) {
row.cells[1].style.fontSize="15px";
row.cells[2].style.fontSize="15px";
row.cells[1].style.fontFamily='verdana';
row.cells[2].style.fontFamily="verdana"
row.cells[1].style.fontWeight="bold"; row.cells[2].style.fontWeight="bold";
} else {
row.cells[1].style.fontSize="13px";
row.cells[2].style.fontSize="13px";
row.cells[1].style.fontFamily='verdana';
row.cells[2].style.fontFamily="verdana"
row.cells[1].style.fontWeight="normal"; row.cells[2].style.fontWeight="normal";
}
}
But it can be more effective ...
you can set color to the table also....
<TABLE id="dataTable" cellspacing="0" borderspacing='1' style='border: solid 1px black; background-color:#EFEFEF'>
SrikantSahu
1-Dec-14 8:29am
View
Hi,
The validation code, is it a function? Also can you please attach your html file.
Thanks
SrikantSahu
30-Nov-14 8:23am
View
That is the constraint with frames. If they load a page from a different domain, they become unaccessible. We no more can access the iframe from our parent page.
However if the iframe belong to the same page as our main/parent page does, we can access the iframe and run the scripts as well.
Can you please check whether both your pages have same domain. Also you can test them by placing them in your same server location.
SrikantSahu
30-Nov-14 1:56am
View
Hi,
Can you please check your boundary condition.
for( i =0; i< rows.length; i++) // here i starts from 0
SrikantSahu
24-Nov-14 2:05am
View
function printPage()
{
var htmlContent="<html><head></head><body ><iframe style='width:800px;height:1200px;' src='http://www.sigmaaldrich.com/catalog/CofADocRequest.do?symbol=209104&LotNo=MKBP0842V&brandTest=SIGMA'></iframe> </body></html>";
newwindow=window.open();
newdocument=newwindow.document;
newdocument.write(htmlContent);
newdocument.close();
}
SrikantSahu
23-Nov-14 2:49am
View
Not sure, what is expected here.
However, if we want to check whether e is defined or not, we generally use typeof.
Example:
if(typeof e === "undefined") {
alert(1);
}
else {
alert(2);
}
SrikantSahu
22-Nov-14 5:40am
View
Deleted
I have created a sample app for you demonstrating the toggling , open & close of the titlepanes. It has been added as an tip to code project, but yet to be published in the site once the reviewers review it.
It should be available @ http://www.codeproject.com/Tips/845301/Dynamic-Dijit-Title-Pane-widgets
SrikantSahu
1-Aug-14 11:44am
View
Jquery has a property 'd' for the returned ajax results.
so the following code should work.
$.each(data.d, function(key,val){
console.log(val.NAME);
});
SrikantSahu
31-Jul-14 16:09pm
View
Hi,
Just trying to understand your problem here..
Do you need a solution to generate dynamic divs or a better way of keeping track of the divs ?
Cheers!
SrikantSahu
1-Nov-13 6:00am
View
Deleted
your approach is correct but clicking the 'Button1' from the iFramePage is not necessary.
function passValue() {
window.parent.document.getElementById('Field').innerHTML = document.getElementById('linkButton1').innerText ;
}
the above function you can call it from OnClientClick in your iframe page.
It will put the content of your linkButton in a div with id 'field' in your main page.
After that if you need to call the server code then you can very well call the 'Button click' from the 'passValue' function.
SrikantSahu
31-Oct-13 8:06am
View
Can you please provide the 'fancyNav' css class
SrikantSahu
7-Oct-13 14:42pm
View
The javascript code that is written for the validation, should be available to the Account creation page. This could be either by reference or the script block on the page itself.
In the onsubmit the function 'check_create_account_form' is supposed to be called, however if the function is not available to the page or if the function returns true, the form will be posted.
You can check the console and use debug points to verify this,
SrikantSahu
17-Sep-13 13:38pm
View
Deleted
The code is working fine as far as toggling the image('hidden2') is concerned. However, visibility:hidden css property leaves the space behind. So you can go with the display property by which the image space will be removed.
//for hiding
document.getElementById('hidden2').style.display= "none";
//for showing
document.getElementById('hidden2').style.display= "block";
Also, It is good to refer the 'readMore' image through the document.getElementById function.
Show More