w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Only IE10 returning Invalid Postback
This may or may not solve the issue. .NET 4 and earlier don't know what IE 10 is. It's not in the list of browsers .NET knows about, so .NET assumes the browser is something that can't handle...well, anything really. Javascript and cookies, and I suspect more, get screwed over. So: Download this: http://www.hanselman.com/blog/content/binary/App_BrowsersUpdate.zip, which is taken from here: http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx, which is referenced from here: IE10 User-Agent causes ASP.Net to not send back Set-Cookie (IE10 not setting cookies) Extract the files and put them in your application's App_Browser directory. Rebuild and see if that works.

Categories : Asp Net

Which control caused postback in apsx page when postback is triggered from JavaScript
Invoking the click event as you are guarantees that the save button will cause the postback. Is there a particular function you want to achieve by not putting your code in the server-side method (savebtn_Click)? Update If you would like to use the name button click for multiple select2 controls, try How to use __doPostBack(). If you just have the one select2, place your code in the button's event and use either of the following to extract the value: selectedValueFromRequest = Request["Select"] OR selectedValueFromControl = Select.SelectedValue

Categories : Javascript

Jscolor stops working after first postback of fresh deploy, but continues to work after postback of a reload
Finally I found a solution. It is so easy!!! I have to add before all input fields with class='color' (binding fileds to the jscolor) this code: <script>jscolor.init();</script>

Categories : Javascript

How can I put data from my datagridview to textboxes?
You will have to do something like this: yourTextBox.Text = yourDataGridView.SelectedRows[0].Cells["Title"].Value.ToString(); yourTextBox2.Text = yourDataGridView.SelectedRows[0].Cells["ISBN"].Value.ToString(); EDIT: I assume that you have selected the row on your datagrid. I´m sorry for the mistake, it was Cells property instead of Columns Hope that helps.

Categories : C#

Show data from textboxes into listview in wpf
The normal way of getting your data into the listview would be through databinding. Databinding is the way that WPF uses to transport data between your view and your code. All wpf controls that can show multiple items, like listview, listbox, combobox etc, has a ItemSource property. By setting this property to an enumerable, the view will display each item in the collection. By default, it will just render each item as a textblock showing the result of calling ToString() on each object. There are several ways of customizing this. In your case, you have defined columns with a GridView and GridViewColumns. Each GridViewColumn has a DisplayMemberBinding which can be binded to the property you want to display in that column. So... I'm not sure how easy it will be for you to use this. As m

Categories : C#

Getting Data From Textboxes Into Multi-Column ListView
Here is an example in WinForms: lstView.Columns.Add("Town"); lstView.Columns.Add("Year"); lstView.Columns.Add("Population"); lstView.View = View.Details; ListViewItem item = new ListViewItem(new []{txtTownName.Text,txtYearEstablished.Text,txtPopulation.Text}); lstView.Items.Add(item);

Categories : C#

Comparing data of two textboxes is not working using jquery
In your html <input type="text" name="t1" /> <input type="text" name="t2" /> You haven'nt provided ID's Your code Should be <input type="text" name="t1" id="t1" /> <input type="text" name="t2" id="t2" /> More over you need to add blur event I guess. $("#t2").blur(function () { if ($("#t1").val() == $("#t2").val()) { $("#lblerror").removeClass("test"); } else { $("#lblerror").addClass("test"); } }); Updated fiddle

Categories : Jquery

VB.NET issue loading textboxes with data from SQL Server
I personally like to use datatables, I find them easier to work with. I'm sure you will have more code to check to make sure dt.rows.count > 0 before actually attempting to work with the data, but here is how I would do it. Dim loadfields_dataadapter As New SqlDataAdapter Dim dt As New DataTable loadfields_dataadapter.Fill(dt) companyname_textbox.text = dt.Rows(0).Item("Company") taxid_textbox.text = dt.Rows(0).Item("TaxIDNumber") accountmanager_textbox.text = dt.Rows(0).Item("AccountManager") Also, keep in mind that NULL fields in the database can cause runtime errors, so you may have to check for those as well.

Categories : Sql Server

Data won't show on page when postback
Edit Alright, I am going to try to help you as best as possible and point a few things out along the way - Open your project in Visual Studio or your editor of choice and do a 'Find', search the entire project, and anywhere you see 'latestValue' used in your viewModels or views, or really anywhere besides inside of your Knockout Library, you need to delete it. If you need a value from a KO Observable or ObservableArray, use the getter function - if (memos._latestValue.length == 0) should be if (memos().length == 0) I know that I have answered a question for you before and recommended this, I went back and double-checked it to be true, but seriously you need to do this, you are bypassing Knockout's core functionality by using _latestValue. I checked a few of the ID observable

Categories : Knockout Js

Keeping Data in GridView after PostBack
This is by design. The problem here is that the SqlDataSource gets re-created when the page loads it does NOT maintains the selectcommand on postback but rather reverts to the one that was set when the DataSource was created. So you need to tell the the SqlDataSource what it had for SelectCommand when it last loaded correctly. Just store the SQL COMMAND in ViewState and enable encryption to protect the contents by setting ViewStateEncryptionMode on the Page directive. [ Always choose security as a standard ] <%@ Page ViewStateEncyptionMode="Always" %> In your button click event store your new command in view state: ViewState["currentCommand"] = "SELECT * FROM USERS WHERE user_id = 1"; UsersSource.SelectCommand = ViewState["currentCommand"]; GridView1.DataBind(); Now in you

Categories : C#

How to populate data from SQL Server database columns to textboxes
SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sql, _conn); SqlDataReader rdr = cmd.ExecuteReader(); System.Data.DataTable tbl = new System.Data.DataTable("Results"); tbl.Load(rdr); if (tbl.Rows.Count > 0) Name.Text = tbl.Rows[0]["column_name"].ToString();

Categories : C#

DisplayFor is not keeping data in ViewModel on PostBack
Only values that are part of an input or other form control will be posted back to the client. DisplayFor is just meant for the model to display its data, nothing else. You have two options; use a hidden field so that the model is populated with the data each time, or fetch the value again. The former method would be fine if your data isn't sensitive because an end user can change the hidden value and repost your form. So for example a UnitPrice would NOT be something you'd want to ever get from the client as even in a hidden field a malicious user can modify the unit price. In that case you'd always want to reload the data yourself and repopulate the model. There's nothing wrong with that either; if the data isn't editable and you need to display it, you need to get it every time.

Categories : Asp Net Mvc

Is it possible for a server to treat a postback as not a postback?
Any asp:button click will cause a postback to the server because asp is a server side language so it has to talk to the server to execute the button click. If you want to do button clicks without talking to the server use something like javascript

Categories : C#

how to insert data from textboxes into mysql database in java-netbeans
You may not use the final String because, then you can't modify these Strings, and the other code is correct, but i think you can use the ? in the line: String sql="INSERT INTO ´donors´ (unit,name) VALUES (?,?)"; //put the rest of the sentence try { PreparedStatement pdt = cn.prepareStatement(sql); pdt.setString(1, jTextField2.getText(); pdt.setString(2, jTextField3.getText(); //put the rest of the code int n1=pdt.executeUpdate(); if(n1>0) { JOptionPane.showMessageDialog(null,"Inserted Successfully!"); } }catch (SQLException ex) { } Well, that's the largest way, but the most correct. I hope this helps.

Categories : Java

How to save data entered in textboxes and later used to do calculations when next button is clicked
Assuming you're using ASP.NET Web Forms ? If you have Viewstate enabled, the textboxes will maintain the values in certain instances. Your next button would have some sort of OnClick functionality tied to your code behidn right? protected btnNext_Click(object sender, Eventargs e) { var value = txtSpousePreventivePhysicalExam.Text; } That's how you would get the value of a specific textbox. You could then store that value in Session for instance to keep the value alive.

Categories : Asp Net

KendoUI DropDownList to populate textboxes with data results using JavaScript
Finally figured it out! Had to change return Json(loc) to return Json(loc, JsonRequestBehavior.AllowGet); For anyone else who ever runs into this issue.

Categories : Jquery

Sending data from usercontrol to main page on postback
create a custom event in user control create a property in usercontrol fire the event when the button is clicked & set the property value access the property in the main page in user control's eventhandler

Categories : Asp Net

how to persist partial view model data during postback in asp.net mvc
Try searching first. This question has been asked many times before. Here is one way to do it: mvc partial view post Summary: wrap each partial in multiple form tags each with their own submit button. But this one seems more like what you're after: Post a form with multiple partial views Use editortemplates for this instead of partials. The issue you're having is that when your DepartmentName textbox isn't being named correctly for your controller to read it. Your POST would be EmployeeName=Prashant&DepartmentName=Phy therefore Department is null, hence the error.

Categories : Asp Net

Dynamically Created Controls losing data after postback
The dynamically generated control do not maintain state. You have to maintain it at your own. You can use some hidden field to keep the state of controls, which will be used on server side to extract the state. Asp.net uses hidden field to maintain the state between requests, you can see __VIEWSTATE in the source. In ASP.NET pages, the view state represents the state of the page when it was last processed on the server. It's used to build a call context and retain values across two successive requests for the same page. By default, the state is persisted on the client using a hidden field added to the page and is restored on the server before the page request is processed. The view state travels back and forth with the page itself, but does not represent or contain any info

Categories : C#

Fetching data from a webpage with asynchronous postback with javascript or c#
I would recommend using a tool like Fiddler to capture the entire requests that are caused by your manual actions, and then send them using WebClient. Also, That way you can capture the requests of WebClient and compare them with the original.

Categories : C#

save state in postback for a data-bound control
Find the control from the repeater's Items, not on the repeater itseld. Try this: void AdverticRp_ItemCommand(object source, RepeaterCommandEventArgs e) { if(e.CommandName == "delete") { RepeaterItem item = e.Item; if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { FileUploader fu = item.FindControl("fu") as FileUploader; // do somthing here } } }

Categories : Asp Net

how to show search data after postback function call in asp.net
Here are some solution : 1- After every user search , Redirect user to page with parameter( like query string) and then on that page retrieve parameter and show appropriate result 2-Asp.net pages by default maintain page state by "View-state" , First make sure ViewState property of the page is True , Then make sure in page life cycle where you have rebind gridview 3-If there is situation in which #2 solution didn't work , There are another solution and that is saving page state in ViewState page explicitly Hope these help

Categories : Asp Net

Getting data back from composite control added to placeholder on postback
I asked this a long time ago, But I think this is how you should do it. Using a factory pattern for user controls. http://weblogs.asp.net/sfeldman/archive/2007/12/17/factory-pattern-for-user-controls.aspx

Categories : Asp Net

Listbox in dynamic web user controls lost data after postback
Your problem is that you are adding the new items in the DOM, but these changes will not necessarily be reflected in your ListBox after a page refresh or PostBack. I could suggest two solutions: 1) Add the elements in the ListBox through .net instead of using Javascript. but if you need a client side solution so that your page won't refresh everytime you add an item: 2) Add a .net HiddenField control. These controls have the advantage of being accessible easily from both Client Side and Server Side. You can add each item in both, the ListItem and the HiddenField (maybe comma separated) and on the server side you will use this HiddenField instead of your ListBox.

Categories : Vb.Net

Passing empty model back to create view after successful add - textboxes still contain data?
Your problem is in ModelState. It contains values that was posted and fill them on client. You can clear it with ModelState.Clear() if i remember this. But it is not so good solution. Good solution redirect to right action instead of returning View(new Tag())

Categories : Asp Net Mvc

How to I create a multi-dimensional random shuffle sorter with textboxes by object name, or data inside object
Either make the value you are shuffling a struct or a class with the three properties, or make a compound control with the three text boxes on and shuffle them, Use index in ValuesToShuffle to calculate Y coordinate. Would be two ways.

Categories : Dotnet

RestSharp for PCL not returning data from ASP.NET Web API
You've triggered an asynchronous HTTP call and never seem to be waiting for it to complete. Try waiting or your unit test might finish much before the Web API is even hit by the request: client.ExecuteAsync<List<Product>>(request, response => { ... }).Result; But in a unit test you probably don't need to be complicated your life with asynchronous HTTP calls. Just use a standard synchronous call and assert on the results received.

Categories : Rest

MS SQL Where Like Clause Not Returning Data
The most likely reason is that there is some unseen character after the 08. One way this could occur is if the field is defined as a char; it would then be padded with spaces. One way to see if there are any such values is to append characters to delimit the value: select '|'+char_data+'|' . . . You have another problem in your query. You are using varchar without a length. Bad, bad, bad. In fact, the convert doesn't seem to be needed at all. You can just do: substring(char_data, 9, 16) LIKE '%BrightSide08' But this is equivalent to: left(char_data, 25) LIKE '%BrightSide08' Or, because you are looking for values at the end of the field: right(char_data, 12) = 'BrightSide08'

Categories : Sql Server

Web app returning data but too slow
Here is what I believe your issues are: Initial page load amounts to 13.1MB (easy, tiger!). Obviously this needs to be addressed. Run all of your PNGs and JPEGs through an optimizer. Here is one that is an add on for Visual Studio. In light of this, on many PCs, the RAM use of the browser process will hit the roof. Chrome hit 250MB for me and Opera 650MB usage. It's a heavy, heavy page with 171 requests on initial page load. That is really high. Consider using sprites for your images as well, consolidate as many as you can, the performance difference is stunning; the higher the number of requests the less efficient a page becomes. Do you really need to preload all those images? Definitely consider the lazy loader you mention or other image loader as appropriate. When the browse names is

Categories : Sql Server

.data() not returning undefined
Use $(this) instead of $(event.target): var postID = $(this).data('postid'); Your code works good if there are not other elements in div. Also consider comparing the target.event with this: event.target The DOM element that initiated the event. read more this In jQuery, the element being acted upon is often passed to the function parameter of a jQuery function as this. It can be made into a jQuery element object by using $(this). read more Example Your code becomes: $(".like").click(function(event){ var postID = $(this).data('postid'); alert(postID); }); As HTML example can be the following: <div class="like" data-postid="903282304865jh"><i>A</i> Test</div> JSFIDDLE

Categories : Jquery

Returning data from if statement
It's not clear which array you are refering to. The only array you're interacting with in the code is enemyDestroyer, which is immediately released from memory after the assignment. Perhaps you could expand you example so we can get a better understanding of what it is you're trying to do? Update To prevent enemyDestroyer from being instantly released youd have to move it to the appropriate scope. That would mean declaring it in the same scope it's going to be used. I suggest reading up on scopes and perhaps switching to an object oriented design.

Categories : C++

Gridview returning empty even when there is data. I want to use data in the gridview to update another database
Per my comment above you may want to do something like: List<string> _OrderIds = new List<string>(); DataTable table = gvOrderLines.DataSource as DataTable; foreach (GridViewRow gvr in table.Rows) { Label myOrderIDLablel = (Label)gvr.FindControl("lblOrderID"); //find control since it is a template field _OrderIds.Add(myOrderIDLablel.Text); } I hope this get you headed in the right direction.

Categories : C#

Returning data from within a Transaction in Laravel 4
You can assign the return values of the transaction closure in a variable like this: $paymentGatewayTransaction = $this->processTransaction($data); $var = DB::connection('new_db')->transaction(function () use ($paymentGatewayTransaction) { //Performing all DB transactions here to insert Order Information. if ($paymentGatewayTransaction['Status'] == "APPROVED") return Response::json(array('Status' => 'Success'), '200'); else return Response::json(array('Status' => 'Error'), '200'); }); return $var; Then you can use $var to return.

Categories : PHP

Datastax c# driver not returning row data
You are trying to fetch the data twice. First when you call rows.Count() > 0 and then during iteration. Once executed and iterated the Rows pseudo-collection is invalid. Therefore the simplest solution for you is to copy all results into the list first. Try this, var rows = rowSet.GetRows().ToList(); And now iterate over the list.

Categories : C#

pymssql not returning result data
You can use this patch: diff --git a/mssqldbmodule.c b/mssqldbmodule.c index 151bc2c..7081715 100644 --- a/mssqldbmodule.c +++ b/mssqldbmodule.c @@ -1934,12 +1934,12 @@ PyObject *get_result(_mssql_connection *conn) { // find a result set that has at least one column conn->last_dbresults = SUCCEED; - while (conn->last_dbresults == SUCCEED && - (conn->num_columns = dbnumcols(conn->dbproc)) <= 0) { + do { Py_BEGIN_ALLOW_THREADS conn->last_dbresults = dbresults(conn->dbproc); Py_END_ALLOW_THREADS - } + } while (conn->last_dbresults == SUCCEED && + (conn->num_columns = dbnumcols(conn->dbproc)) <= 0); check_cancel_and_raise(conn->last_dbresults, conn); http://lists.ibiblio.org/piper

Categories : Python

class data returning null after being set
You are creating two variables. One as attribute in BasicInfo_Assets_Fragment, the other as attribute in Option_ListFragment. They are completely different variables. If you have a reference to the BasicInfo_Assets_Fragment instance (lets call it biaf) in the Option_ListFragment, you can reference its view attribute as biaf.storeModel, and that will give what you want. Best practice is to make storeModel private and add a getStoreModel() method to the BasicInfo_Assets_Fragment. Also, try to follow Java naming conventions.

Categories : Java

Why is data("selectable") returning "undefined"?
If you notice this comment for the selected answer to the StackOverflow question you reference, it says that for later versions of the jQuery UI library, you should use .data("ui-selectable") instead of .data("selectable"). Hopefully that is the reason for the error you are getting because I see nothing else wrong with your code.

Categories : Jquery

XMLElementnot returning data in Oracle 10g
Get it resolved by converting the output using .getClobVal(). Below is the query SELECT XMLElement("Emp", XMLElement("ID", e.emp_id), XMLElement("Name", e.emp_name))**.getClobVal()** AS "RESULT" FROM emp_metadata e;

Categories : SQL

SQLite returning wrong data
Try this one select AUTHORS_ABSTRACT.ABSTRACTSITEM_ID, ABSTRACT_AFFILIATION.AFFILIATION_NUMBER, AUTHORS_AFFILIATE.ABSTRACTAUTHOR_ID from AUTHORS_ABSTRACT left join ABSTRACT_AFFILIATION on AUTHORS_ABSTRACT.ABSTRACTAUTHOR_ID = ABSTRACT_AFFILIATION._id left join AUTHORS_AFFILIATE on ABSTRACT_AFFILIATION._id=AUTHORS_AFFILIATE.ABSTRACTAFFILIATION_ID ORDER BY AUTHORS_ABSTRACT.ABSTRACTSITEM_ID ASC

Categories : Database

SQL query not returning data from where clause
Try this: SELECT * FROM #PreModuleAllData WITH(NOLOCK) WHERE (@Country = 'DEFAULT' OR @Country = '' OR ([Language] = @Country )) AND (@UserType = 'DEFAULT' OR @UserType = '' OR ([UserType] = @UserType )) AND (@Group = 'DEFAULT' OR @Group = '' OR ([Company] = @Group )) AND (@CodeUsage = 'DEFAULT' OR @CodeUsage = '' OR ([User Code]= @CodeUsage ))

Categories : SQL



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.