模式字母窗口操作
来源:互联网 发布:淘宝部分商品退款 编辑:程序博客网 时间:2024/06/10 01:23
exp1
1.Add one image button in datagrid ,and code the javascript to pop up a model window .
<FooterTemplate>
<IMG style="CURSOR: hand" onclick=javascript:ShowReference(); src="<%=Request.ApplicationPath%>/images/reference.gif">
</FooterTemplate>
<script language="javascript">
function ShowReference(){
//get the skuid from the modaldialog and refresh this page.
var SKU = window.showModalDialog('<%=Request.ApplicationPath%>/OM/FrmSKUReference.aspx', window.document, "dialogWidth:600px;dialogHeight:700px;");
if(SKU.length != null)
{
window.location.href('<%=Request.ApplicationPath%>/OM/FrmOrderItems.aspx');
}
}
</script>
2.in Model window get what u select in DataGrid
aspx:
<!add a hidden var to save the return value.>
<INPUT id="hdCloseWnd" type="hidden" name="hdCloseWnd" runat="server">
<ItemTemplate>
<!add a radiobutton >
<hlcontrols:radiobutton id="rdbProduct" AutoEventWireup="true" AutoPostBack=true text='<%#DataBinder.Eval(Container.DataItem,"ProductSKU").ToString().Trim()%>' runat="Server" onCheckedChanged="Radio_Clicked">
</hlcontrols:radiobutton>
</ItemTemplate>
add javascript ,close the window after getting what u select
<script language="javascript">
//this script block is to set the return value of this search window with the chosen SKU id.
var closeWnd = document.Form1.hdCloseWnd;
window.returnValue = document.Form1.hdCloseWnd.value;
if(closeWnd!=null && closeWnd.value.length > 0)
{
window.close();
}
</script>
cs:
protected void Radio_Clicked(object source, EventArgs e)
{
Herbalife.WebControls.RadioButton rbt = source as Herbalife.WebControls.RadioButton;
Session[SessionKey.SearchCriteriaVO] = null;
Session["SKUid"] = rbt.Text.Trim();
hdCloseWnd.Value = rbt.Text.Trim();
}
3 .In Main WIndow Add some code to get the seesion value when bounding the datagrid
cs:
private void InitializeComponent()
{
this.dgOrderItem.ItemCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgOrderItem_ItemCommand);
this.dgOrderItem.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgOrderItem_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load);
}
private void dgOrderItem_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Footer)
{
Herbalife.WebControls.TextBox txtNSKU = e.Item.FindControl("txtNSKU") as Herbalife.WebControls.TextBox;
txtNSKU.Text = (string) Session["SKUid"];
Session.Remove("SKUid");
}
}
exp2
Sub WIndow :
aspx:
protected System.Web.UI.HtmlControls.HtmlInputHidden hdCloseWnd;
<script language="javascript">
var closeWnd = document.Form1.hdCloseWnd;
window.returnValue = document.Form1.hdCloseWnd.value;
if(closeWnd!=null && closeWnd.value.length > 0){
window.close();
}
</script>
cs:
protected void Radio_Clicked(object source, EventArgs e)
{
Herbalife.WebControls.RadioButton rbt = source as Herbalife.WebControls.RadioButton;
Session[SessionKey.SearchCriteriaVO] = null;
Session[SessionKey.CustomerID] = rbt.Text.Trim();
hdCloseWnd.Value = rbt.Text.Trim();
}
Main Window:
aspx:
<script language="javascript">
function ShowSearchCust(){
cusID = window.showModalDialog('<%=Request.ApplicationPath%>/OM/FrmSearchCust.aspx', window.document, "dialogWidth:500px;dialogHeight:500px;");
txt = document.getElementById("ucHerbalifeIDControl_txtCustomerID");
if(cusID.length >0)
{
txt.value = cusID;
}
}
</script>
cs:
protected Herbalife.WebControls.ImageButton imglookup;
private void Page_Load(object sender, System.EventArgs e)
{
imglookup.Attributes.Add("onclick","javascript:ShowSearchCust();");
}
- 模式字母窗口操作
- 模式窗口对父窗口的操作
- Direct 窗口模式(非独占模式)贴图操作
- 窗口操作
- 窗口操作
- 窗口操作
- 窗口操作
- 模式窗口
- dos命令窗口无法输入字母解决办法
- 子窗口操作父窗口
- 位操作,大写字母转成小写字母,小写字母转成大写字母
- JavaScript - 模式窗口和非模式窗口
- js 模式窗口、非模式窗口
- 32BPP窗口模式下24位位图的像素操作(1)
- 32BPP窗口模式下24位位图的像素操作(2)
- 运维日记007 - vim操作总结(三、可视化模式与多窗口)
- 窗口操作函数
- 窗口相关操作总结
- 联通 vs 移动
- [转]视频捕捉全教程(vc+vfw)
- Java开发者必去的技术网站
- 抉择中
- 公司经营管理中存在的几个问题
- 模式字母窗口操作
- 从CEO到CAO看企业文化发展
- oracle 学习日记(一)
- 墨者何在?
- fcitx 在英文环境下的安装和配置
- SQL Server 数据库突然不能使用解决问题回顾
- 保持TreeView(微软的)父子节点的CheckBox节点状态一致的一种方法
- 当SQL Server数据库崩溃时如何恢复?
- Session