Joga – from Google & NikeFootball.com

GoogleNikeFootball.com 联合推出了一个足球迷的网站 Joga.com,作为球迷,自然想领先进入其中,看看里面藏了哪些好东西,但目前这个网站还只能通过邀请才能加入,可惜呢,提交了自己的Gmail,提示说几周内便可收到邀请,”漫漫”等吧-_-!!

“欢迎光临 Joga – 为真正体现足球精神的玩家而建的社区。

Joga 旨在为您提供一个结识其他球员、分享足球体验、欣赏来自世界各地的精彩图片和视频的场所。

快来加入,一起告诉整个世界足球到底该怎么玩。

祝你玩的尽兴!”

Untitled-1.jpg

Atlas

http://www.microsoft.com/downloads/details.aspx?FamilyId=B01DC501-B3C1-4EC0-93F0-7DAC68D2F787&displaylang=en

上面的链接是微软Atlas套件最新版的下载地址,版本为March_CTP(三月社区预览版),2006-3-20发布,应该是最新的了,看了这段(mms://wm.microsoft.com/ms/uifx/asp_net_atlas.wmv)介绍在Visual Studio 2005中使用的录像,感觉Ajax越来越”平易近人”了,呵呵,不用写任何Javascript,便能实现基本的添加、删除、修改、排序等等操作,这个是大大加快了程序开发的速度呢。

Technorati :

Live Messenger现在已经不用邀请便可以使用了!

微软现在已开放了Live Messenger的使用,不再需要邀请了,只要你有一个MSN Messenger或者Passport的帐户,便能使用。Live Messenger的下载地址:

简体中文版:http://download.microsoft.com/download/b/9/e/b9e30b83-7d45-4c09-9934-afe2ace2c515/Install_Messenger_Beta.exe

不过大家不要对这个Live Messenger的”新功能”报太大的期望,我使用了几次后,感觉和以前的MSN Messenger没什么区别。

“灰镇”—-花源

因事去了趟成都花源镇,到老街吃了出名的新津黄辣丁,味道确实巴适,但这里更深印象的是”灰镇”,能见度不到20米,吃顿饭回来,头发变成了稻草一样,感觉鼻子喉咙里全是灰,就差没上呼吸道感染了-_-!!要是有相机,真该照下个写真,把好吃的黄辣丁和漫天土灰都拍下来。

准确获得页面、窗口高度及宽度的JS

function getPageSize(){

var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac…would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}

var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}

// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}

// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}

arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}

Technorati :

更新GridViewRow的数据

最开始常遇到更新GridViewRow数据的问题,现在把方法记下来。

前台页面代码:

<asp:GridView ID="gvwDepartments" runat="server" OnRowCancelingEdit="gvDepartment_RowCancelingEdit" OnRowEditing="gvDepartment_RowEditing" OnRowUpdating="gvDepartment_RowUpdating" OnRowDeleting="gvDepartment_RowDeleting">
<Columns>
<asp:TemplateField HeaderText="部门名称">
<EditItemTemplate>
<asp:TextBox ID="txtDepName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvDepartment" runat="server" ControlToValidate="txtDepName" ErrorMessage="请填写 部门名称。"></asp:RequiredFieldValidator>
<asp:HiddenField ID="hfID" runat="server" Value='<%# Bind("ID") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>

<asp:HiddenField ID=”hfID” Value=’<%# Bind(“ID”) %>’ runat=”server” />
</ItemTemplate>
<ItemStyle Width=”400px” />
</asp:TemplateField>
<asp:TemplateField ShowHeader=”False”>
<EditItemTemplate>
<asp:LinkButton ID=”LinkButton1″ runat=”server” CausesValidation=”True” CommandName=”Update” Text=”更新”></asp:LinkButton>
<asp:LinkButton ID=”LinkButton2″ runat=”server” CausesValidation=”False” CommandName=”Cancel” Text=”取消”></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID=”LinkButton1″ runat=”server” CausesValidation=”False” CommandName=”Edit” Text=”编辑”></asp:LinkButton>
<asp:LinkButton ID=”LinkButton2″ runat=”server” CausesValidation=”False” CommandName=”Delete” Text=”删除” OnClientClick=”return confirm(‘确定删除该部门信息吗?’);”></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

后台代码:

#region 控件事件

protected void btnCreateDepartment_Click(object sender, EventArgs e)
{
viwDepartment.SetActiveView(viwNew);
}

protected void btnCreate_Click(object sender, EventArgs e)
{
if (IsValid)
{
CreateDepartment();
}
}

protected void btnCancel_Click(object sender, EventArgs e)
{
viwDepartment.SetActiveView(viwDetails);
}

protected void gvDepartment_RowEditing(object sender, GridViewEditEventArgs e)
{
BeginEditDepartment(e.NewEditIndex);
}

protected void gvDepartment_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
CancelEditDepartment();
}

protected void gvDepartment_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
if (IsValid)
{
UpdateDepartment(e.RowIndex);
}
}

protected void gvDepartment_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DeleteDepartment(e.RowIndex);
}

#endregion

#region 私有方法

private void CreateDepartment()
{
Department newDepartment = new Department(Guid.NewGuid(), txtNewDepName.Text.Trim());

try
{
GeneralConfig.CreateDepartment(newDepartment);
}
catch (Exception ex)
{
pnlMessage.ShowError(“操作失败,详细信息:” + ex.Message);
return;
}

BindDepartments();

txtNewDepName.Text = String.Empty;
viwDepartment.SetActiveView(viwDetails);

pnlMessage.ShowMessage(“添加部门信息成功。”);
}

private void BeginEditDepartment(int rowIndex)
{
gvwDepartments.EditIndex = rowIndex;
BindDepartments();
}

private void CancelEditDepartment()
{
gvwDepartments.EditIndex = -1;
BindDepartments();
}

private void UpdateDepartment(int rowIndex)
{
GridViewRow row = gvwDepartments.Rows[rowIndex];

HiddenField hfID = (HiddenField)row.Cells[0].FindControl(“hfID”);
TextBox txtDepName = (TextBox)row.Cells[0].FindControl(“txtDepName”);

Guid depID = new Guid(hfID.Value);

Department dep = new Department(depID, txtDepName.Text.Trim());

try
{
GeneralConfig.UpdateDepartment(dep);
}
catch (Exception ex)
{
pnlMessage.ShowError(“操作失败,详细信息:” + ex.Message);
return;
}

gvwDepartments.EditIndex = -1;

BindDepartments();

pnlMessage.ShowMessage(“更新部门信息成功。”);
}

private void DeleteDepartment(int rowIndex)
{
GridViewRow row = gvwDepartments.Rows[rowIndex];

HiddenField hfID = (HiddenField)row.Cells[0].FindControl(“hfID”);

Guid depID = new Guid(hfID.Value);

try
{
GeneralConfig.DeleteDepartment(depID);
}
catch (Exception ex)
{
pnlMessage.ShowError(“操作失败,详细信息:” + ex.Message);
return;
}

BindDepartments();

pnlMessage.ShowMessage(“删除部门信息成功。”);
}

private void BindDepartments()
{
gvwDepartments.DataSource = GeneralConfig.GetDepartments();
gvwDepartments.DataBind();
}

#endregion

Technorati :