w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
asp.net findcontrol method return null after AsyncPostBackTrigger
I solve my problem from this site: enter link description here protected void Page_Load(object sender, EventArgs e) { //http://www.aspdotnetfaq.com/Faq/how-to-determine-whether-an-asynchronous-partial-postback-has-occurred-on-page.aspx // get a reference to ScriptManager and check if we have a partial postback if (ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack) { // partial (asynchronous) postback occured // insert Ajax custom logic here } // enable property is re-creating page controls else if (!Page.IsPostBack || enable) { //enable = false; if (Page.Request["Page"] != null || Page.Request["Page"] != "") {... ] thank from this site.

Categories : Asp Net

null value in findcontrol of gridview, item template confusion
refer this http://www.codeproject.com/Articles/37207/Editable-Gridview-with-Textbox-CheckBox-Radio-Butt also put your code for Edit command. it might be RowEditing or RowCommand

Categories : C#

Ext.net:PreviousPage.FindControl issue
you can do it in the client side by calling window.parent.Ext.getCmp('MyWindow').close(); Edit the closest to a code behind call is to use btnClose.AddScript("window.parent.Ext.getCmp('MyWindow').close();"); Edit 2 if you code is more complex like reloading a grid or modifying forms, you do the following: Code-Behind X.Call("ReloadGrid"); JavaScript function ReloadGrid() { var grid = window.parent.Ext.getCmp('GridId'); //grid reloading code }

Categories : Asp Net

populating a text box with FindControl
Firstly , test your function likes TextBox txtAddress = (TextBox)FindControl("tbxReturnAddress"); or You can try likes this , TextBox txtAddress = (TextBox)Page.FindControl("tbxReturnAddress"); Edit If your text-box is in the UpdatePanel , TextBox txtAddress = (TextBox)UpdatePanel1.FindControl("tbxReturnAddress");

Categories : C#

FindControl inside repeater not working
FindControl is only capable of finding server-side controls, not plain HTML tags. Therefore in this particular Repeater it is not likely to find anything. However you can always turn HTML tag into server-side control with runat: <input runat="server" type="checkbox" name="checkboxSelect" id="checkboxSelect" class="custom" /> Now every checkboxSelect will be added into collection of controls, and FindControl will be able to find it.

Categories : C#

ASP.NET get text from Gridviewrow cell with findControl
That's the right idea, just a little bit off: row.FindControl("columnName") Gives you an actual object. Exactly what it returns depends on what is specified in the ASP portion. Could be a label, could be a text box, checkbox... After you have the object, you can access the properties as you normally would. In this case, you'll probably want the Text property. row.FindControl("...").Text If you'd rather use position indexes, something like this also works: row.Cells[i].Controls[1] Where i is the 0 based index for the item, starting from the left.

Categories : Asp Net

Can't find fields using FindControl in a FormView
FindControl() receives the ID for the control you are looking for. From ASPX code you posted I'm not seeing that you are setting the ID property for DynamicControls you are trying to find using FindControl(). This call to that method: TextBox itemsCostTextBox = (TextBox)row.FindControl("ItemCosts"); is passing the DataField property value instead of the ID. Add the ID property to all DynamicControls that you want to find. Also take into account that FindControl() does not perform a recursive search, it only looks for a control with the specified ID between the control's children.

Categories : C#

Why isn't this returning null?
You should use isNaN(value); to check for NaN Because: console.log(NaN === NaN); // false! NaN is not equal to itself. This may seem weird but it makes sense if you think about the nature of NaN. Let's say you have this code: var a, b, c; // a = 0;oops a is still undefined so we'll get NaN if we do an operation with it b = 5; c = 6 if (a + b === a + c) { console.log("math error?"); } You don't want to come to the seeming conclusion that 5 === 6.

Categories : Javascript

Why is this returning a NULL
I bet this runs on a 64bit system and your code looks like this: int main() { char *str=get_str(); printf("received str %s with len %d ", str, strlen(str)); } char *get_str() { char *str; int slen=get_strlen(); str=(char *)malloc(sizeof(char)*slen); set_str(str); printf("returning str %s with len %d ", str, strlen(str)); return str; } To fix this, add the appropriate prototyping: char *get_str(); before the function's first usage. On (most?) 32bit systems pointer are 32bit wide, which is the same size as an int to which the compiler defaults the function as the prototpye is missing, so although using a wrong type the value gets pass back up successfully. The latter won't work anymore on a 64bit system as pointers (on most systems) are wider than a

Categories : C

@Value returning null
Are you passing valid value expressions? For properties placeholder you can use something like: @Value("${directory.extDirectory}") You can also use Spring EL and get all the goodness from it using the #{value} check the docs here Is also possible to assign a default value in case the property is not found @Value("${directory.extDirectory:defaultValue}")

Categories : Spring

How to find the DataListItem item type without using FindControl?
The best option is: var radio = item as RadioButton; if(null != radio) { // It's a radio button! // The "as" keyword will return null if the cast fails } Alternatively, you can use the clearer if(item is RadioButton) { var radio = (RadioButton)item; } But that results in two casts, which is less efficient.

Categories : Asp Net

not able to find .FindControl while coding in rowupdating event
TextBox txtUname = (TextBox)gv.DataKeys[e.RowIndex].FindControl("txtEmpName"); instead use Rows as TextBox txtUname = (TextBox)gv.Rows[e.RowIndex].FindControl("txtEmpName"); And it should be "EditItemTemplate" instead of "EmptyDataTemplate"

Categories : C#

Set Properties of User Control on Event Using FindControl
You have to use a recursive FindControl implementation because FindControl will only find direct childs. Your control is inserted in a naming container at a lower level. A generic FindControlRecurisve from MSDN: private Control FindControlRecursive(Control rootControl, string controlID) { if (rootControl.ID == controlID) return rootControl; foreach (Control controlToSearch in rootControl.Controls) { Control controlToReturn = FindControlRecursive(controlToSearch, controlID); if (controlToReturn != null) return controlToReturn; } return null; } from MSDN Or, if you only have one specific conatiner like in your sample: MyControl ctl = this.MyControlPlaceHolder.FindControl("mycontrol"); if (ctl != null){ ctl.MyProperty = true

Categories : C#

combobox returning null value in c#
Reason is clear that you have no text selected You've to select any item in combobox first. To do so try any of the following Set SelectedIndex to some valid index Set SelectedItem to a valid item in combobox through code Select an item in combobox by clicking it Then use following code MessageBox.Show(comboBox1.SelectedText); or if(comboBox1.SelectedItem != null)//check for null since `SelectedItem` can be null when nothing selected MessageBox.Show(comboBox1.SelectedItem.ToString()); Note: As @tim pointed in comments SelectedText approach won't work when DropDownStyle set to DropDownList. In that case you've to use SelectedItem approach

Categories : C#

NSDate returning NULL
The space between hh:mm and a in your format string is likely causing it to fail. Instead you'll want to do this: [dateFormatter setDateFormat:@"yyyy-MM-dd hh:mma"];

Categories : IOS

getResourceAsStream("abc.xml") returning null
Your code is working. All you need to do is to check if src/test/resources is on your classpath and you should be fine (Project properties -> java build path) I just recreated your scenario and it worked fine. //Both snippets should work (don't forget to prepend a slash if using getClass().getResourceAsStream) System.out.println(this.getClass().getClassLoader().getResourceAsStream("a/b/c/file.txt")); System.out.println(this.getClass().getResourceAsStream("/a/b/c/file.txt"));

Categories : Java

shell_exec() returning null on "ls"
Add 2>&1 to the end of your shell command to have STDERR returned as well as STDOUT. $output = shell_exec("ls /root/files/saves 2>&1"); Also, if the user running PHP don't have the sufficient permissions to view the output in /root/, then the above code will return a Permission denied error message. Source: http://php.net/manual/en/function.shell-exec.php#28994

Categories : PHP

GetMethod returning null
As you've discovered in your edit, the actually ASPX page gets compiled into a class that inherits from _Default (where your code is located). So you need to make DynamicHandler (at least) protected rather than private. Specify BindingFlags.FlattenHierarchy also: this.GetType().GetMethod("DynamicHandler", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy);

Categories : C#

PHP: array_search returning null
Assuming that your array will always contain contiguous numbers, and you can verify that your second SQL call returns one of those numbers, I would say something like $value = $freeRooms[$roomNb] I'm personally unfamiliar with how array_search executes, however if you wanted to write your own, I assume it would look something like this function IndexOf($searchValue,$array) { $i = 0; for( $i = 0; $i < count($array); $i++ ) if( $array[$i] == $searchValue ) return $i; }

Categories : PHP

Returning NULL Structure
Your function return type is CvBox2D, so you can't convert a (NULL) pointer to it. If you really need to return "nothing" if the check inside the function fails, you can change the return type to a pointer to CvBox2D: CvBox2D* function() { ... } You will also have to change the way the returned object is created inside your function. Note that using raw pointers in C++ usually isn't a good idea. Take a look at std::shared_ptr (available in C++11) if you think you really have to use pointers.

Categories : Opencv

WURFLManager always returning null
Well I found the answer. It seems as though the API must have changed at some point. I'm not able to find out if the DLL we are using has been updated. But anyway here is the solution: var mgr = WURFLManagerBuilder.Build(new ApplicationConfigurer()); var device = WURFLManagerBuilder.Instance.GetDeviceForRequest(Request.UserAgent);

Categories : Misc

imageItem returning null in c#
The as operator is like a cast operation. However, if the conversion isn't possible, as returns null instead of raising an exception so if current item in layer.Items is not ImageItem you get null assigned to imageItem in this line ImageItem imageItem = item as ImageItem;

Categories : C#

JSP getAttribute() returning null
You are not typecasting it to String. request.getAttribute() will return an Object. Try using this and see if it works: String value = (String)request.getAttribute("colnames"); Or <%= (String)request.getAttribute("colNames") %> Why are you using forEach here? You just need to display a String right? Also, shouldn't var="col" be ------> var = "colNames" <tr> <c:forEach items="${param.colNames}" var="col"> <td>${col}</td> </c:forEach> </tr>

Categories : Java

lua_touserdata is returning null
I think it may be the way your dealing with the userdata's metatable. Specifically, I think what you're returning from createUserInfo() is a table not a userdata. What I suggest is that you create the metatable once e.g. in luaopen, and then just set that on the new userdata. Something like this... int createUserInfo(lua_State *L) { UserInfo *userInfo = [[UserInfo alloc] init]; UserInfoData **userInfoData = (UserInfoData **)lua_newuserdata(L, sizeof(userInfo)); *userInfoData = userInfo; luaL_getmetatable(L, "userInfoMeta"); lua_setmetatable(L, -2); return 1; } LUALIB_API int luaopen_XXX(lua_State *L) { luaL_newmetatable(L,"userInfoMeta"); luaL_openlib(L, NULL, userInstance_methods, 0); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); ...

Categories : Objective C

twitter api 1.1 - returning NULL
It works fine for me. My results are here: http://pastebin.com/FB1zpuuT Start by verifying that you can connect to this in your web browser. https://api.twitter.com/1.1/statuses/user_timeline.json If you can connect to that, you will see an error message. If not, the problem is likely your network blocking Twitter, or Twitter blocking your ip address.

Categories : PHP

LayoutParams returning null
Here tc.getLayoutParams() you haven't given it any params yet so it will return null. Maybe you meant descriptiontv.getLayoutParams() Edit Try changing params.leftMargin = 30; params.rightMargin = 30; to params.setMargins(30, 0, 30, 0); And change LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams)tc.getLayoutParams(); to LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

Categories : Android

Jaxb returning null value
The mappings on your object model do not map the XML document this is why it isn't populating correctly during the unmarshal operation. You can get a sense of this by populating your object model and then marshalling it to see the XML output. Below is a set of mappings you could use instead. JAVA MODEL XmlImportConfig Since indexFields is a repeating element it is best to map it to a list field/property. import java.util.ArrayList; import javax.xml.bind.annotation.*; @XmlRootElement(name="XmlImportConfig") @XmlAccessorType(XmlAccessType.FIELD) public class XmlImportConfig { @XmlElement(name="indexfields") private ArrayList<IndexFields> listOfIndexFields; public ArrayList<IndexFields> getListOfIndexFields() { return listOfIndexFields; } } Inde

Categories : Java

why is my php code returning a null value?
Trail and error debugging when the php code is sending you the null value.. i think you mean 0 with null? Because i think your code breaks here? catch (PDOException $ex) { $response["success"] = 0; $response["message"] = "Database Error. Couldn't add post!"; die(json_encode($response)); }

Categories : Java

Node Js (Returning null)
I had the same problem. I got my code to work by using ObjectID in the 'mongodb' library: var ObjectID = require("mongodb").ObjectID; //more code here query._id = { $gt: ObjectID(myId) }

Categories : Node Js

startActionMode returning null
So I finally found a workaround which is probably NOT the best solution, but i didn't find any other solutions. I did a kill process in the onDestroy on my activity. like this : android.os.Process.killProcess(android.os.Process.myPid()); It is working now. It seems that my phone wasn`t clearing the memory of something. EDIT: I can't use this solution because I have a service which need to be open even if the app is closed. The killProcess kill the service too. EDIT 2 I finally found the source of my problem. I was keeping a static variable of one of my fragment. For some reason, that variable was kept in memory even when restarting the app. I still don`t know exactly why startActionMode is returning null. To fix it, i've instantiate my variable in the onCreate of my activity.

Categories : Java

View returning null
You should use findViewById() only once in the right context. Three ways you could achieve this with your code: Change Activity to contain your GestureListener and the AsynkTask as inner classes and reference the field iv of your Activity Keep GestureListener and AsynkTask as standalone classes and add the MyImageView as parameter to their constructor. Construct the two instances for this two classes in onCreate() after the findViewById() Put GestureListener and AsynkTask as inner classes of MyImageView and add MyImageView as parameter to their constructor. When constructing the two instances from within MyImage just pass this. findViewById() is context sensitive. This means it searches for a view starting at the current context. If the current context is an Activity it searches thru t

Categories : Android

Why below function returning me null instead of 1?
Your function returns nothing until your array count is 1. Because your return statement is in if block. <?php function endWithNumber($input) { if (count(array_unique($input)) == 1) return $input[0]; $maxVal = max($input); $maxKey = array_search($maxVal,$input); foreach ($input as $k => $v) { if ($maxKey != $k && $maxVal != $v) { $newVal = ($maxVal - $v); $input[$maxKey] = $newVal; break; } } return endWithNumber($input); } $input = array(6,10,15); var_dump(endWithNumber($input)); exit; ?>

Categories : PHP

STR_TO_DATE() Returning NULL
You'd need to assign something to the variable you're using with STR_TO_DATE, something like LOAD XML LOCAL INFILE 'C:\xampp\mysql\data\test.xml' REPLACE INTO TABLE games (id, GameTitle, @var1) ROWS IDENTIFIED BY '<Game>' SET ReleaseDate = STR_TO_DATE(@var1, '%c/%e/%Y'); Note that the syntax for SET in LOAD XML is described in the syntax for LOAD DATA

Categories : Mysql

strtok returning null at the end
Fix as below :- if (strncmp(command, "echo", MAX_INPUT_SIZE) == 0) { space = strtok(NULL, " "); //eat the "echo" while (space != NULL) { printf("%s ", space); <----+ space = strtok(NULL, " "); | // printf("%s ", space); -----+ } }

Categories : C

Xml Parsing returning null tag
this code works for me..suit it according to your needs Edit: for parsing from iternet: URL url = new URL("http://api.discogs.com/artist/ac/dc"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(url.openStream())); doc.getDocumentElement().normalize(); XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); Dom parser DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse("D:/workspace1/dd.xml"); XPathFa

Categories : Android

Moq Setup returning null
Assuming that your interface is declared similarly to the following: public interface IGenericRepository<T> { T SingleOrDefault(Func<T, bool> predicate); } Specifying a delegate in Setup won't work. See Issue 300: Mocking Method with Delegate as Parameter. I get a NotSupportedException when I tried it. Instead, try this: accountRepositoryMock.Setup(r => r.SingleOrDefault(It.IsAny<Func<Account, bool>>())) .Returns(new Account { AccountId = 99999999, Valid = true }); There's a more detailed example at Moq framework Func<T,T>

Categories : Misc

findFragmentByTag returning null
Try using the tag on the activity's FragmentManager directly. The complete reference of your example seems to be this. Follow this example with more details, you will see that the writer keeps track of tabs and their tag.

Categories : Android

Returning another value if preferred value is null
You need the coalesce function which looks like: SELECT COALESCE(T1.PRICE,"MISSING") FROM [TABLE] You can find more information on it in your RDBMS' documentation but this will return "missing" if the field returns a NULL.

Categories : SQL

SQL query returning null?
You shouldn't try to select a new custom ID like this before you actually insert the record, as someone else may insert that same value before you. So here's how you can potentially run your table inserts: insert into John_IEP_Crossing_Dock_Shipment (MyCol1, MyCol2, ID) select @MyFormValue1, @MyFormValue2, convert(varchar(10), current_timestamp, 20) + '-' + right('000' + cast(cast(right(coalesce(max(ID), '0'), 4) as smallint) + 1 as varchar(4)), 4) from John_IEP_Crossing_Dock_Shipment where ID like convert(varchar(10), current_timestamp, 20) + '%'; -- like may use an index in this case We're coming up with the ID during the insert, not before. This should mostly solve the contention issue (heck, you can only have 9,999 inserts per day anyway with that 4-digit I

Categories : SQL

SQL CLR Aggregate incorrectly returning null
If 1 + R2.MonthlyReturn is positive, I would considered use of exp(sum(log(...))) equivalent: SELECT R1.InstrumentId, R1.MonthEnd, R1.MonthlyReturn, EXP(SUM(LOG(1 + R2.MonthlyReturn))) AS TotalReturn FROM Returns R1 INNER JOIN Returns R2 ON R2.InstrumentId = R1.InstrumentId AND R2.MonthEnd <= R1.MonthEnd WHERE R1.InstrumentId BETWEEN 1 AND 50 GROUP BY R1.InstrumentId, R1.MonthEnd, R1.MonthlyReturn ORDER BY R1.InstrumentId, R1.MonthEnd

Categories : Sql Server



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