在GridView的文本框Asp.Net中使用OnBlur事件 [英] Work with OnBlur Event inside GridView's Text box Asp.Net

查看:155
本文介绍了在GridView的文本框Asp.Net中使用OnBlur事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在gridview中创建功能,例如...

我的网格中有3个文本框

1.ProductID.
2.ProductName.
3.ProductSize.

我使用JQuery向用户提供建议来输入 ProductName ,它可以正常工作并完美显示.但是现在我想使用该 ProductName 并搜索数据库并填充 ProductID ProductSize

通过传递我的ProductName并获取 ProductID ProductSize ,我使用了AJAX Querystring的onBlur事件.直到对我来说一切正常.但是,将其放入相应行时,它对我不起作用.甚至我使用StyleSheet Class都将相应的值分配给文本框,其将那些值分配给整个网格而不是特定的行.


请帮帮我...


在此先感谢.

Hi All,

I want to create functionality in gridview like...

I have 3 textbox inside my grid

1.ProductID.
2.ProductName.
3.ProductSize.

I used JQuery to enter ProductName by giving Suggestions to the user.Its works fine and display Perfectly. But now i want to use that ProductName and search the DB and fill the ProductID and ProductSize

I used onBlur event using AJAX Querystring, by passing my ProductName and getting the ProductID and ProductSize. Till that works fine for me. But while Place it into the Respective row its not works for me. Even i used StyleSheet Class to assign the respective values to the text box, its assign those values to entire grid not that particular row.


Please help me out...


Thanks in Advance.

推荐答案

尝试以下链接.
http://forums.asp.net/t/1278872.aspx [
Try the following link.
http://forums.asp.net/t/1278872.aspx[^]


从onblur事件处理程序中,您可以调用您的页面方法.试试这个链接.

希望这对您有帮助!
From the onblur event handler you can call your page methods. Try this link.

Hope this helps!


在注册OnBlur事件时,您可以通过服务器端在gridview的行数据绑定事件上向函数提供其他两个文本框的ClientId.
这样,您的OnBLur事件的客户端函数将具有文本框的ClientId,然后在这些文本框中设置值.
While you are registering the OnBlur event, you can provide the ClientId of your other two textboxes to the function through the server side on row databound event of your gridview.
This way your client side function for OnBLur event will have ClientId of textbox and then you set values in those textboxes.


这篇关于在GridView的文本框Asp.Net中使用OnBlur事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆