|
I am a programmer but not for web apps. 40+ years of programming. I am not family with jQuery and have very basic Java knowledge.
Need the techniques to be used.
In vb.Net windows desktop you can bring up a modal screen or MessageBox but that stops everything. I do not want the progress indication to stop anything.
The problem is not switching visible to invisible div's or controls but getting the data from / to controls and the 'running' form.
I am not trying to populate the grid in periodically but the progress i.e. lblMsg.text = "Doing Record#=nnn"
|
|
|
|
|
I make windows applications, so I know that the messagebox stops the message pump running in the Windows OS.
The thing here is, your working with HTTP protocol, and you have to obey the rules of it.
On top of that, your working with HTML, which are elements, and not objects, sorry for the correction.
So with the HTTP protocol, it's pretty much get and post, get a page, post a page back to the server.
It would be a waste of time to keep submitting the form back for each piece of data transmitted, to show detailed progress.
So you use a client script, that runs on the browser, to transmit each piece of data in the background, and change the DOM.
The DOM is the collection of HTML that is downloaded from the server making up a web page.
You can alter the HTML elements, delete, append, change text by manipulating the DOM using Javascript or JQuery.
A working example here, that switches address input to progress, fetches the address, populates the textboxes, switches back to address input.
I would experiment, or just write code that gets each line of data on your form, and run the AJAX call to web service in a loop, creating new HTML for each record processed. So instead a progress, they just see the data uploading, and new HTML records created.
This would fool or give the illusion of progress, without having a bar or wheel. I suppose a fake progress sort of message box could be made with an HTML div that expands in witdh, colored green or blue.
If you look at my Tip, I wrote a filmstrip that just loops, until the end is reached. The same principal could apply for your solution, in which 1 function just calls another function, until the end is reached.
The primary function collects the data, the child function posts the data, and prints a result.
If you need help on this, you can private message me.
Display Advertising Filmstrip[^]
function Selected_Shipping_Address_Load(m_Data1) {
var panel_CardInfo = $('[id*="_panel_MP_CardInfo_Container"]');
var panel_Progress = $('[id*="_panel_MP_Progress_Container"]');
if (panel_CardInfo.css('display') === 'inline-block') {
panel_CardInfo.css('display', 'none');
panel_Progress.css('display', 'inline-block');
}
else {
panel_CardInfo.css('display', 'none');
panel_Progress.css('display', 'inline-block');
}
var m_secureToken = $('[id*="_txt_Secure_Token_Field"]').val();
var m_localization = parseInt($('[id*="_txt_Localization_Field"]').val());
var send_Data =
"{" +
"\"m_Data1\" : \"" + m_Data1 + "\", " +
"\"m_Localization\" : " + m_localization + "," +
"\"m_secureToken\" : \"" + m_secureToken + "\" " +
"}";
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "MakePayment.asmx/load_ShippingAddress",
data: send_Data,
dataType: "json",
error: function (xhr, status, error) {
exitCode = 2;
alert(xhr.responseText);
},
success: function (responseText) {
var objB = jQuery.parseJSON(responseText.d);
exitCode = objB.exit_Code;
if (exitCode > 0) {
alert('Error Occured');
}
else {
var address_ID = objB.address_ID;
var address_Attention = unescape(objB.address_Attention.replace(/\+/g, " "));
var address_CompanyName = unescape(objB.address_CompanyName.replace(/\+/g, " "));
var address_Streetline1 = unescape(objB.address_Streetline1.replace(/\+/g, " "));
var address_Streetline2 = unescape(objB.address_Streetline2.replace(/\+/g, " "));
var address_City = unescape(objB.address_City.replace(/\+/g, " "));
var address_State = unescape(objB.address_State.replace(/\+/g, " "));
var address_Postal = unescape(objB.address_Postal.replace(/\+/g, " "));
var address_Country = unescape(objB.address_Country.replace(/\+/g, " "));
var address_Phone = unescape(objB.address_Phone.replace(/\+/g, " "));
var address_Residental = objB.address_Residential;
var address_ShippingIsBilling = objB.address_ShippingIsBilling;
$('[id*="_txt_MP_CompanyName_Field"]').val(address_CompanyName);
$('[id*="_txt_MP_StreetAddress1_Field"]').val(address_Streetline1);
$('[id*="_txt_MP_StreetAddress2_Field"]').val(address_Streetline2);
$('[id*="_txt_MP_City_Field"]').val(address_City);
$('[id*="_ddl_MP_CountryCode_Field"]').val(address_Country);
switch (address_Country) {
case 'US':
load_States_US(address_State);
break;
case 'CA':
load_States_CA(address_State);
break;
case 'MX':
load_States_CA(address_State);
break;
}
$('[id*="_ddl_MP_StateCode_Field"]').val(address_State);
$('[id*="_txt_MP_PostalCode_Field"]').val(address_Postal);
$('[id*="_txt_MP_Phone_Field"]').val(address_Phone);
panel_Progress.css('display', 'none');
panel_CardInfo.css('display', 'inline-block');
}
}
});
}
|
|
|
|
|
Thanks let me play with that technique.
|
|
|
|
|
Requirement: textbox limit: 25characters, max limit:40char allow
IF text contains {State},count for {State} only is 16,
{City} count 14, {St}=2,{Zip}=5
Problem:
I have written JQuery code for this (below code) but it accepts
1.25chars={City}123456789—correct
2.25charcters=1234567891245678{City}-wrong- but it also accepting this one
3.25-chareacters=123456789123456789{City}---wrong- but it also accepting this one
1 dropdown:MainContent_ddlSelectAdLine Options: HeadLine
1 Textbox: MainContent_txtAdline onkeyup=”
<input name="ctl00$MainContent$txtAdline" type="text" id="MainContent_txtAdline" onkeyup="getBatch(event);" style="border-style:Inset;width:85%;" maxlength="50">
1 Span: MainContent_lblCount—for charcters Counting
50
Jquery Code:
function getBatch(e) {
debugger;
var len=0;
var cnt = $("#MainContent_txtAdline").val();
var count = $("#MainContent_txtAdline").val().length;
if (cnt.indexOf("{City}") > -1)
{len = 16;$("#MainContent_lblCount").html(16);count = count-6+len}
else if (cnt.indexOf("{State}") > -1) { len = 14; count = count - 7 + len }
else if (cnt.indexOf("{St}") > -1) { len = 2; count = count - 4 + len }
else if(cnt.indexOf("{Zip}")>-1){len=5; count=count-5+len}
else { len = 0; count=count+len}
if (count <= 0) {
count = 0;
}
var ddlslectedText = $("#MainContent_ddlSelectAdLine option:selected").text();
if (ddlslectedText == "HeadLine") {
if (cnt.indexOf("{City}") > -1)
{ $("#MainContent_txtAdline").attr('maxlength', '30'); }
else if (cnt.indexOf("{State}") > -1)
{ $("#MainContent_txtAdline").attr('maxlength', '30'); }
else if (cnt.indexOf("{St}") > -1)
{ $("#MainContent_txtAdline").attr('maxlength', '30'); }
else if (cnt.indexOf("{Zip}") > -1)
{ $("#MainContent_txtAdline").attr('maxlength', '40'); }
else { $("#MainContent_txtAdline").attr('maxlength', '40'); }
if (count > 25) {
$("#MainContent_lblCount").html(count).css('color', '#CC0000');
}
else { $("#MainContent_lblCount").html(count).css('color', '#000000'); }
}
}
|
|
|
|
|
Procedure or function 'listdtlsearch' expects parameter '@name', which was not supplied.
|
|
|
|
|
|
It's fairly self-explanatory. You need to supply the procedure with a parameter. Exactly how you do this depends on how you are calling the code, which we don't know as you didn't paste your code.
|
|
|
|
|
The error should be clear. However, what happens sometimes is someone has code like this:
cmd.Parameters.AddWithValue("@name", name);
and if the name variable is null you'll get that error. If name is null then you need to supply DBNull.Value instead.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi try following
1 check name in procedure and in code behind should be same
2 or check procedure name
i think it is typo error
|
|
|
|
|
my web page in table is create but update and delete functionality is not worked.......to plz help me
my html table
<div class="outer">
<div class="inner">
<div class="page-header"><!-- Page header -->
<h5><i class="font-home"></i>Data Display</h5>
<ul class="icons">
<li><a href="#" class="hovertip" title="My tasks"><i class="font-tasks"></i></a></li>
<li><a href="#" class="hovertip" title="Reload data"><i class="font-refresh"></i></a></li>
<li><a href="#" class="hovertip" title="Settings"><i class="font-cog"></i></a></li>
</ul>
</div><!-- /page header -->
<div class="body" >
<div class="block well">
<div class="table-overflow">
<table class="table table-striped" id="data-table">
<thead>
<tr>
<th>Id</th>
<th>State Name</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
asp.net code
public void DataLoad()
{
DataSet ds = obj.gd("select * from state where adminid='" + Session["idd"] + "'");
for (int i = 0; i < ds.Tables[0].Rows.Count;i++ )
{
htmlTable.Append("<tr>");
htmlTable.Append("<td>" + ds.Tables[0].Rows[i]["id"] + "</td>");
htmlTable.Append("<td>" + ds.Tables[0].Rows[i]["state"] + "</td>");
htmlTable.Append("<td>" + "<a href='#'> <i class='icon-pencil' /> </i></a>" + "</td>");
htmlTable.Append("<td>" + "<a href='#'> <i class='icon-remove' /> </i></a>" + "</td>");
htmlTable.Append("</tr>");
}
PlaceHolder1.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
|
|
|
|
|
use jquery
Help people,so poeple can help you.
|
|
|
|
|
Hi Developers,
Hope everybody doing well ..
I'm trying to work with ASP.net membership also integrated with my APP,
first I've created a sample web app to create the new users to membership table
I've Added the membership tag to web.config and change the connection string to my Database connString also I set ApplicationName to "\".
then I added "CreateUserWizard" control with the following code:
Membership.CreateUser(CreateUserWizard1.UserName,CreateUserWizard1.Password,CreateUserWizard1.Email);
But when I run the code, I have the following exception :
http://www.m5zn.com/newuploads/2015/03/21/jpg//9a5f11556559e6b.jpg[^]
Anyone help please
|
|
|
|
|
The column it's referring to isn't referenced in the line of code you provided. May need more code in order to help. Something is referencing the ApplicationName column, and it doesn't exist in the database.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
I want to display the name of the user that is currently logged on in the system.
PS:- Using VS-2013, ASP.NET and I am freshers so please be specific Don't have much idea about authorization, identity or authentication.
Thank You
|
|
|
|
|
Then the better thing would be to first go and learn ASP.NET's authentication modules, or the framework being used. You might be using Identity; or a WebSecurity -based method of authentication which can be answered by the way you create your application -- as a new project or a new website.
If that is the WebSecurity [^]-based application (a website), then you can do that like this,
var username = WebSecurity.CurrentUserName;
Or you can get the UserId of the user and query the database to get the Name.
Otherwise, if you're using Identity[^], then you would have to query the database anyway; Entity Framework has got you covered!
You can get the values from the database as,
db.Users.FirstOrDefault(x => x.Id == someUserId);
You can then move on and learn other basics about ASP.NET from MSDN, or the best option. Test, try and solve method!
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I attended an Interview last sunday. One of my interview question is,
"Why the validation in Update Panel is not working properly in Asp.net? And what is the reason?"
I tried some reference article in Google but not yet cleared due to some language problem. Can anyone tell me the reason? or please provide some source to clear my question.
Hope my question is clear as well.Dunno where should i post this? If my question is not here in a right forum, please guide me to correct session.
Regards,
Rajeshwaran
~R@JEES#
|
|
|
|
|
Given the detail you've supplied the only answer I could give is "Because it hasn't been coded properly".
|
|
|
|
|
Yes i too have the same answer. But, little bit confusion when he asked this question to me. Because having less knowledge about Validation in Update panel. He asked me why it's not working properly? there i struck.
~R@JEES#
|
|
|
|
|
How to check that textbox data entered by the user exist on the db(MS Access) or not and if it exist in db than on the basis of that fetch the data and display on gridview else show error msg on label.
Note:- Using VS-2013 Asp.net webform with c#
|
|
|
|
|
It is a pretty simple task, just get the data from your TextBox, search the database and if there is a record then show the data. Ok, let me talk to you in C#.
var val = textBox1.Text;
if(hasRows) {
} else {
}
You can then execute the function based on the data that was returned from the database.
SqlDataReader on MSDN[^].
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Build a "select" query that returns the data you're interested in, or define a query in the Access DB that does the select and call the query. If you get any rows back bind them to the gridview, otherwise show an error label.
Is there something in particular you are stuck on? Is it reading user input? Using queries? Using the gridview? Conditionally showing messages?
|
|
|
|
|
If your really good at this, you use JQuery client side programming, and either bind a blur event to the textbox, or create a textbox with a blur event that links to a JQuery Function.
Then write a JQuery Ajax request to a web service, in which the web service returns the data you need, and do something with the result.
In the web service, you perform all your server side programming, but it happens in the background without a postback to the server, keeping the web app smooth in motion and fast in speed.
Introduction to using jQuery with Web Services[^]
Other wise, you have to postback the textbox data to the server, and fetch new stuff and repopulate the HTML or form (Gridview)
When developing on a local machine, folks forget about speed, and long it takes. So consider form design for this,
Is this an optimum time to check the data entered, and force the user to wait 10 seconds or so?
|
|
|
|
|
Could you Please Answer my interview Question::
1. Interface main Use for real time and opps concepts? Its only have signature. So why in need Interface & apstract class??? Some people say we use these for Large amount of class to handle easily? But why should i need this?
2. What is route Collection action if we declare Default 1 Default 2
3. you have 2 record website traffic. The table contain we site name (Multiple website). Page Name IP Address and UTC datetime. What would be the Query to show all websites visited in the last 30 days with total number or visits if unique page view and total number of unique visitors (Using IP Address)
4.You have 3 fields ID Date and Total Your table contains multiple rows for the same day which is valid data however for reporting purpose you need to show only one row per day. The row with the highest ID Per day should be returned the rest should be hidden from users( not returned)
5. find the smallest sub-string in s1 containing all characters of s2
Ans : s2.substring(s1) is correct????
6.How to handle Temp Table in sql?
7. How to update Male to Female and Female to male in Single SQL Updating Query.
8.How to stored User Viewed URL in sql from MVC
Thank you For advantage ...,
|
|
|
|
|
It is inappropriate to ask us volunteers to answer in detail all 8 questions. Perhaps if you had a single specific question we would gladly help. #6 doesn't even make any sense, by the way. The rest of the questions seem incomplete as well.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i use jquery for infinite scroll. i just invoke my page method by jquery and page method return data in json format which jquery parse and jquery push those data into div and append that div in page. when user scroll to end of the page then loading data. so this way user scroll and scroll to read data and jquery just append the div in the page again and again which make heavy the pages and this cause my page slow and some time crash.
so guide me how to develop infinite scroll as a result my page would not be slow and crash?
i guess if i could remove div from my page when it goes out of viewport but if user again scroll upward then again i need to load that data and append in the page. this logic is getting tough for me to design whole things. so anyone can help with code sample to implement this or redirect to me any code sample or write up which help me to do this.
looking for guidance. thanks
tbhattacharjee
|
|
|
|
|