dynamically generated pageview issue - telerik

I have created dynamic tab function. When i create dynamic tab it will create pageview for that tab. But when i deleted that tab that pageview is not deleting. Can any one help me to fix this.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;
using Telerik;
public partial class Radstrip2 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label PageContent;
protected System.Web.UI.WebControls.Repeater BuildingSummary;
protected Telerik.WebControls.PageView PageView1;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Tab tab = new Tab();
tab.Text = string.Format("New Page {0}", 1);
RadTabStrip1.Tabs.Add(tab);
PageView pageView = new PageView();
RadMultiPage1.PageViews.Add(pageView);
BuildPageViewContents(pageView, RadTabStrip1.Tabs.Count);
RadTabStrip1.SelectedIndex = 0;
}
}
private void BuildPageViewContents(PageView pageView, int index)
{
pageView.ID = "Page " + index.ToString();
pageView.Controls.Add(new LiteralControl(" <B>New page</B>" + (index).ToString()));
}
protected void Button1_Click(object sender, EventArgs e)
{
Tab tab = new Tab();
tab.Text = string.Format("New Page {0}", RadTabStrip1.Tabs.Count + 1);
RadTabStrip1.Tabs.Add(tab);
PageView pageView = new PageView();
pageView.ID = "Page " + pageView.Index.ToString();
RadMultiPage1.PageViews.Add(pageView);
BuildPageViewContents(pageView, RadTabStrip1.Tabs.Count);
RadTabStrip1.SelectedIndex = RadTabStrip1.SelectedIndex + 1;
RadMultiPage1.SelectedIndex = RadTabStrip1.SelectedIndex;
}
protected void Button2_Click(object sender, EventArgs e)
{
Tab currentTab = RadTabStrip1.InnerMostSelectedTab;
if (currentTab != null)
{
ITabContainer owner = currentTab.Owner;
owner.Tabs.Remove(currentTab);
//RadMultiPage1.PageViews.Remove(currentTab.PageView);
if (owner.Tabs.Count > 0)
{
owner.SelectedIndex = 0;
}
}
}
protected void RadMultiPage1_PageViewItemCreated1(PageView view, int viewIndex)
{
BuildPageViewContents(view, viewIndex + 1);
}
}

I see that in your Button2_Click() method you remove the currently selected tab but you don't remove the current page view. You can try with:
RadMultiPage1.PageViews.RemoveAt(RadMultiPage1.SelectedIndex);
This should remove the currently selected page view

Related

Xamarin forms TabbedPage

I am using Tabbed page in my xamarin forms project.
I am trying to use OnTabReselected event in MyTabsRenderer Class in android. But the events like OnTabSelected, OnTabReselected and OnTabUnselected are not getting called. Does anyone have any solution for this.
xamarin forms version: 3.2.0.871581
VS version : 15.8.6
Here is my code snippet(MyTabsRenderer Class):
using Android.OS;
using Android.Views;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android.AppCompat;
using MyProject;
using MyProject.Droid;
using Xamarin.Forms.Platform.Android;
using System.ComponentModel;
using Android.Support.V4.View;
using Android.Content.Res;
using Android.Content;
using Android.Support.Design.Widget;
[assembly: ExportRenderer(typeof(TabController), typeof(MyTabsRenderer))]
namespace MyProject.Droid
{
public class MyTabsRenderer : TabbedPageRenderer, TabLayout.IOnTabSelectedListener
{
bool setup;
ViewPager viewPager;
TabLayout tabLayout;
public MyTabsRenderer(Context context) : base(context)
{
}
protected override void SetTabIcon(TabLayout.Tab tab, FileImageSource icon)
{
base.SetTabIcon(tab, icon);
}
protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
{
base.OnElementChanged(e);
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
//if (setup)
// return;
if (e.PropertyName == "Renderer" || e.PropertyName == "CurrentPage")
{
viewPager = (ViewPager)ViewGroup.GetChildAt(0);
tabLayout = (TabLayout)ViewGroup.GetChildAt(1);
setup = true;
ColorStateList colors = GetTabColor();
for (int i = 0; i < tabLayout.TabCount; i++)
{
var tab = tabLayout.GetTabAt(i);
SetTintColor(tab, colors);
}
tabLayout.SetOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
}
}
void OnTabReselected(TabLayout.Tab tab)
{
// To have the logic only on he tab on position 1
if (tab == null || tab.Position != 1)
{
return;
}
if (tab.Text == "Play")
{
tab.SetText("Pause");
tab.SetIcon(Resource.Drawable.icon);
// App.pauseCard = false;
}
else
{
tab.SetText("Play");
tab.SetIcon(Resource.Drawable.icon);
// App.pauseCard = true;
}
SetTintColor(tab, GetTabColor());
}
void SetTintColor(TabLayout.Tab tab, ColorStateList colors)
{
var icon = tab?.Icon;
if (icon != null)
{
icon = Android.Support.V4.Graphics.Drawable.DrawableCompat.Wrap(icon);
Android.Support.V4.Graphics.Drawable.DrawableCompat.SetTintList(icon, colors);
}
}
ColorStateList GetTabColor()
{
return ((int)Build.VERSION.SdkInt >= 23)
? Resources.GetColorStateList(Resource.Color.icon_tab, Forms.Context.Theme)
: Resources.GetColorStateList(Resource.Color.icon_tab);
}
}
}
It is probably because you are setting the OnTabSelectedListener wrong.
Try setting the listener to this instead: tabLayout.SetOnTabSelectedListener(this);
Also for inspiration check out TabbedPageRenderer.cs source code,

Loading Image while service gets data using Xamarin Forms

In my application in login page i want loading image with message "Loading" in xamarin forms before the service gets data.
For that i used Activity indicator like this:
ActivityIndicator indicator = new ActivityIndicator { Color = Color.Blue, };
indicator.IsRunning = false;
indicator.IsVisible = false;
indicator.HorizontalOptions = LayoutOptions.CenterAndExpand;
indicator.VerticalOptions = LayoutOptions.CenterAndExpand;
and after click on Login button,I added code like this
indicator.IsRunning = true;
indicator.IsVisible = true;
now i am getting loading image only and in the same screen.But i want like the above image.can anyone suggest me to solve this.
Thanks in advance
You can use following library for the Dialogs
It supports Xamarin.Forms aswell
https://www.nuget.org/packages/Acr.UserDialogs/
EDIT 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
**using Acr.UserDialogs;**
using Xamarin.Forms;
using Splat;
namespace ProjectScreen
{
public partial class MainPage : ContentPage
{
public ObservableCollection<MainPageViewModel> projects { get; set; }
public SQLite.Net.SQLiteConnection _connection;
public bool IsLoading;
public MainPage()
{
projects = new ObservableCollection<MainPageViewModel>();
InitializeComponent();
this.getConnection();
foreach (Project Pname in this.GetProjects())
{
projects.Add(new MainPageViewModel { Name = Pname.name });
lstView.ItemsSource = projects;
}
AddNewItem.Clicked += (o, s) =>
{
this.PromptCommand();
};
lstView.ItemSelected += LstView_ItemSelected;
}
private void LstView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
**UserDialogs.Instance.ShowLoading("Loading data");**
Task.Run(() => { waitForMinute(); });
}
private async void waitForMinute()
{
await Task.Delay(10000);
**UserDialogs.Instance.Loading().Hide();**
Device.BeginInvokeOnMainThread(() =>
{
Navigation.PushAsync(new NavigationPage(new ProjectDetails()));
});
}
}
}
}
Lines indicated with ** are for AcrDialog You can use them in any file as per your requirement
make Sure you run them on main thread

Xamarin Forms timepicker 24hour

I'm new to Xamarin.Forms and i can't seems to find how to show the dialog in a 24hour format instead of a AM/PM
can someone help me ?
Thank you
This page is really usefull to learn how to format dates in C#:
https://msdn.microsoft.com/en-us/library/8kb3ddd4%28v=vs.110%29.aspx
And with this code I was able to show a 24 hour format:
TimePicker timePicker = new TimePicker
{
Format = "HH:mm"
};
The only solution i found is here:
24h timepicker
Basically a custom renderer within each platform project will be needed.
Xamarin.iOS:
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using PersonalTrainer.iOS.View.Controls;
[assembly: ExportRenderer (typeof (TimePicker), typeof (TimePicker24HRenderer))]
namespace YourNamespace.iOS.View.Controls {
public class TimePicker24HRenderer : TimePickerRenderer {
protected override void OnElementChanged(ElementChangedEventArgs<TimePicker> e) {
base.OnElementChanged(e);
var timePicker = (UIDatePicker)Control.InputView;
timePicker.Locale = new NSLocale("no_nb");
}
}
}
For Android:
[assembly: ExportRenderer(typeof(TimePicker), typeof(TimePicker24HRenderer))]
namespace YourNamespace.Droid.View.Controls {
public class TimePicker24HRenderer : ViewRenderer<Xamarin.Forms.TimePicker, Android.Widget.EditText>, TimePickerDialog.IOnTimeSetListener, IJavaObject, IDisposable {
private TimePickerDialog dialog = null;
protected override void OnElementChanged(ElementChangedEventArgs<TimePicker> e) {
base.OnElementChanged(e);
this.SetNativeControl(new Android.Widget.EditText(Forms.Context));
this.Control.Click += Control_Click;
this.Control.Text = DateTime.Now.ToString("HH:mm");
this.Control.KeyListener = null;
this.Control.FocusChange += Control_FocusChange;
}
void Control_FocusChange(object sender, Android.Views.View.FocusChangeEventArgs e) {
if (e.HasFocus) { ShowTimePicker(); }
}
void Control_Click(object sender, EventArgs e) {
ShowTimePicker();
}
private void ShowTimePicker() {
if (dialog == null) {
dialog = new TimePickerDialog(Forms.Context, this, DateTime.Now.Hour, DateTime.Now.Minute, true);
}
dialog.Show();
}
public void OnTimeSet(Android.Widget.TimePicker view, int hourOfDay, int minute) {
var time = new TimeSpan(hourOfDay, minute, 0);
this.Element.SetValue(TimePicker.TimeProperty, time);
this.Control.Text = time.ToString(#"hh\:mm");
}
}
}
For Windows Phone:
[assembly: ExportRenderer (typeof (MyTimePicker), typeof (TimePicker24HRenderer))]
namespace YourNamespace.WindowsPhone.View.Controls {
public class TimePicker24HRenderer : TimePickerRenderer {
// Override the OnElementChanged method so we can tweak this renderer post-initial setup
protected override void OnElementChanged (ElementChangedEventArgs<Xamarin.Forms.TimePicker> e) {
base.OnElementChanged (e);
if (Control != null) {
var nativeControl = (Windows.UI.Xaml.Controls.TimePicker)Control;
nativeControl.Foreground = new SolidColorBrush(Colors.Gray);
Control.ClockIdentifier = "24HourClock";
}
}
}
}
In XAML you can set the the 24 hours format string to TimePicker by using the Format property:
<TimePicker Format="HH:mm"/>
Ok. You have to do it plateform specific.. I did something like that.
So create an interface
public interface TimePickerInterface
{
void showTimePicker (ButtonOrLabel lbl);
}
In Android you create your timepicker class
[assembly:Dependency(typeof(yournamespace.MyTimePicker))]
namespace yournamespace
{
public class MyTimePicker:Java.Lang.Object,TimePickerInterface,Android.App.TimePickerDialog.IOnTimeSetListener
{
String originalText="";
LabelOrButton lbl=new LabelOrButton();
public void showTimePicker(LabelOrButton lbl)
{
var c = Forms.Context;
originalText = lbl.Text;
this.lbl = lbl;
var time = DateTime.Now.TimeOfDay;
TimePickerDialog dialog = new TimePickerDialog(c,this,time.Hours,time.Minutes,true);
dialog.SetCanceledOnTouchOutside (true);
dialog.Show ();
}
public void OnTimeSet (Android.Widget.TimePicker view, int hourOfDay, int minute)
{
if(view.IsShown)
lbl.Text = (hourOfDay<=9 ? ("0"+hourOfDay+""):hourOfDay+"")+":"+(minute<=9 ? ("0"+minute+""):minute+"");
}
}
}
And in your xamarin forms you call it in actionlistener of your button or gesturerecognizer of your label:
DependencyService.Get<TimePickerInterface> ().showTimePicker(myButtonOrLabel);
You can do the same thing for DatePicker..
Hope it helps..

Show image from SQL Server 2008 in datagridview C#

I'm tired of searching for a solution. please help me.
I have a table with columns
p_id (int)
p_name (varchar50)
category (int)
price (money)
picture (Image)
Insertion process works perfectly, it is also showing me my database records.. but it sow me my filepath in gridview rather than show image...
Please help me... it is part of my project... and I don't know how to show retrieve image from database in Datagridview
I have done all my SQL connection work in Dall Class
Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Image_task
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void insert_btn_Click(object sender, EventArgs e)
{
try
{
int count;
dall insert = new dall();
int id = Convert.ToInt32(id_txt.Text);
string name = name_txt.Text;
int cat = Convert.ToInt32(cat_txt.Text);
decimal price = Convert.ToDecimal(price_txt.Text);
string image=pic_txt.Text;
count = insert.insrt_up_del("insert into product values('" + id + "','" + name + "','" + cat + "','" + price + "','" + image + "')");
MessageBox.Show("Insert Successfully", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Form1_Load(object sender, EventArgs e)
{
insert_btn.Enabled=false;
}
private void browse_txt_Click(object sender, EventArgs e)
{
insert_btn.Enabled = true;
openFileDialog1.Filter = "Images (*.BMP;*.JPG;*.GIF,*.PNG,*.TIFF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF|" + "All files (*.*)|*.*";
if (openFileDialog1.ShowDialog()==DialogResult.OK)
{
pictureBox1.Image = new Bitmap(openFileDialog1.FileName);
pic_txt.Text = openFileDialog1.FileName;
}
}
private void search_btn_Click(object sender, EventArgs e)
{
dall select = new dall();
DataTable dt = new DataTable();
dt = select.select("Select * from product");
dataGridView1.DataSource = dt;
//DataGridViewImageColumn img = new DataGridViewImageColumn();
//img.DataPropertyName = "Picture";
//img.Width = 200;
//img.HeaderText = "Picture Column";
//img.ReadOnly = true;
//img.ImageLayout = DataGridViewImageCellLayout.Normal;
//dataGridView1.Columns.Add(img);
//dataGridView1.DataSource = new BindingSource(dt,null);
}
}
}
use data adapter
DataAdapter da = new DataAdapter("Select * from product",youconnection);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;

Cannot set permission for documents on Visual web part Sharepoint 2010 Foundation

Good day! I have an event handler that, when you add a document to the library redirects the user to a web form with the parameters of the document. In the web form, it displays the current user in the form of Checkboxlist. The user selects the appropriate group, and he presses the Save button. Following are assigned permissions to the document according to the selected group. The problem is that the resolution of the document is not assigned according to selected groups. Here's the handler code:
using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
using System.Web;
using System.IO;
namespace SharePointProject3.EventReceiver2
{
/// <summary>
/// События элемента списка
/// </summary>
public class EventReceiver2 : SPItemEventReceiver
{
private HttpContext _context;
public EventReceiver2()
{
_context = HttpContext.Current;
}
public override void ItemAdding(SPItemEventProperties properties)
{
//Временно отключаем срабатывание обработчика
EventFiringEnabled = false;
//Получаем файл из HttpContext
HttpPostedFile file = _context.Request.Files[0];
Stream fileStream = file.InputStream;
byte[] fileByte = new byte[file.ContentLength];
fileStream.Read(fileByte, 0, file.ContentLength);
//Загружаем файл в библиотеку документов
SPFile fileUploded = properties.Web.Files.Add(properties.AfterUrl, fileByte);
//Включаем обработчик обратно
EventFiringEnabled = true;
//Отменяем добавление файла, которое делал пользователь
properties.Cancel = true;
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
//Деламе редирект
properties.RedirectUrl = properties.Web.Url + "/test_perm/default.aspx?ID=" + fileUploded.UniqueId;
}
}
}
And here's the code of the Web Part:
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Text;
using Microsoft.SharePoint.Utilities;
namespace CustomGroupAssignment.VisualWebPart1
{
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
using (SPSite site = new SPSite("http://kviten:83/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser currentUser = web.CurrentUser;
SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Test_Doc_Lib"];
SPGroupCollection webGroups = currentUser.Groups;
CheckBoxList1.DataSource = webGroups;
CheckBoxList1.DataValueField = "ID";
CheckBoxList1.DataTextField = "Name";
CheckBoxList1.DataBind();
foreach (ListItem li in CheckBoxList1.Items)
{
li.Selected = true;
}
try
{
string itemID = Page.Request.Params["ID"];
SPDocumentLibrary doclib = (SPDocumentLibrary)web.GetList(SPUrlUtility.CombineUrl(web.Url, "/DocLib2/Forms/AllItems.aspx"));
SPListItem item = doclib.GetItemByUniqueId(new Guid(itemID));
}
catch (Exception ex)
{
//Выводим ошибку
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
using (SPSite site = new SPSite("http://kviten:83/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser currentUser = web.CurrentUser;
SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Test_Doc_Lib"];
try
{
string itemID = Page.Request.Params["ID"];
SPDocumentLibrary doclib = (SPDocumentLibrary)web.GetList(SPUrlUtility.CombineUrl(web.Url, "/Test_Doc_Lib/"));
SPListItem item = doclib.GetItemByUniqueId(new Guid(itemID));
//Break the role inheritance from List and remove any RoleAssignments
//item.BreakRoleInheritance(false);
//while (item.RoleAssignments.Count > 0)
//{
// item.RoleAssignments.Remove(0);
//}
if (!item.HasUniqueRoleAssignments)
{
item.ResetRoleInheritance();
item.Update();
item.BreakRoleInheritance(false);
item.Update();
}
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected) //Response.Write("- " + li.Text + "<br/>");
{
// Give permissions to a specific group
SPGroup group = web.Groups.GetByID(Convert.ToInt32(li.Value));
SPPrincipal principalGroup = group;
SPRoleAssignment roleassignment_group = new SPRoleAssignment(group);
SPRoleAssignment roleAssignment = item.RoleAssignments.GetAssignmentByPrincipal(principalGroup);
item.RoleAssignments.Add(roleAssignment);
item.Update();
}
}
}
catch (Exception ex)
{
//Выводим ошибку
}
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();
}
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();
}
}
}
I can not understand why I cannot assign permissions to the document! Help please!
If you use the / / Response.Write ("-" + li.Text + "<br/>"); which commented out, we can see that the checkboxes are not selected and not displayed. item.ResetRoleInheritance(); executed and permission assigned to only the current user with no groups. In what could be the reason?
The right solution for a web part:
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Text;
using Microsoft.SharePoint.Utilities;
namespace CustomGroupAssignment.VisualWebPart1
{
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
using (SPSite site = new SPSite("http://kviten:83/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser currentUser = web.CurrentUser;
SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Test_Doc_Lib"];
SPGroupCollection webGroups = currentUser.Groups;
CheckBoxList1.DataSource = webGroups;
CheckBoxList1.DataValueField = "ID";
CheckBoxList1.DataTextField = "Name";
CheckBoxList1.DataBind();
foreach (ListItem li in CheckBoxList1.Items)
{
li.Selected = true;
}
try
{
string itemID = Page.Request.Params["ID"];
SPDocumentLibrary doclib = (SPDocumentLibrary)web.GetList(SPUrlUtility.CombineUrl(web.Url, "/DocLib2/Forms/AllItems.aspx"));
SPListItem item = doclib.GetItemByUniqueId(new Guid(itemID));
}
catch (Exception ex)
{
//Выводим ошибку
}
}
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
using (SPSite site = new SPSite("http://kviten:83/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser currentUser = web.CurrentUser;
SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Test_Doc_Lib"];
string itemID = Page.Request.Params["ID"];
SPDocumentLibrary doclib = (SPDocumentLibrary)web.GetList(SPUrlUtility.CombineUrl(web.Url, "/Test_Doc_Lib/"));
SPListItem item = doclib.GetItemByUniqueId(new Guid(itemID));
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected) //Response.Write("- " + li.Text + "<br/>");
{
if (!item.HasUniqueRoleAssignments)
{
item.ResetRoleInheritance();
item.Update();
}
item.BreakRoleInheritance(false);
item.Update();
SPGroup group = web.Groups.GetByID(Convert.ToInt32(li.Value));
SPPrincipal principalGroup = (SPPrincipal)group;
//SPRoleAssignment roleassignment_group = new SPRoleAssignment(principalGroup);
SPRoleAssignment roleAssignment = item.Web.RoleAssignments.GetAssignmentByPrincipal(principalGroup);
item.RoleAssignments.Add(roleAssignment);
item.Update();
// var roleAssignment = new SPRoleAssignment(principalGroup);
// item.RoleAssignments.Add(roleAssignment);
// item.Update();
}
}
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();
}
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();
}
}
}

Resources