生成请求ID [英] Generate Request ID

查看:192
本文介绍了生成请求ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建一个请求表单.向共享点提交数据时,我会生成类似
的RequestID
"2010-1"
每个请求都有一个ID"2010-2"等.

我尝试使用ID为ID的年份的补充...没有用
使用隐藏字段...无用..

Hi,

I am creating a Request form.when submitting data to sharepoint i ned to generate RequestID like

"2010-1"
"2010-2"etc...for every request one id.

I have tried using concatination of Year with ID field...no use
use Hidden field...no use..

so anyone can pls tell me how to do that??

推荐答案

亲爱的,
您已经使用用户控件和WebPart创建了自定义页面.然后,您可以使用.Net代码逻辑来生成请求ID.


使用对象模型在列表中插入项目.以下是该步骤的

步骤:
1.创建一个用户控件,并通过使用关键字使用Microsoft.Sharepoint命名空间.

2.在添加"或提交"按钮上,使用生成请求的id逻辑,然后使用SPSite mySite = new SPSite ["Url"];
SPWeb myWeb = mySite.openWeb();
SPList myList = myWeb.List ["ListName"];
SPListItem NewItem = ListName.Items.Add();
根据需要使用列
myList.Name = txtName.text.trim();
与其他列相同
NewItem ["Name"] = txtAskSaad.Text;
NewItem"Date"] = System.DateTime.Now;
CurrentWeb.Update();

3.在Visual Studio 2005中创建一个类类型的解决方案,然后
在该Webpart上使用用户控件.

3.部署解决方案
4.在web.config中作为安全控件输入

并在您的应用程序中使用此Webpart


希望对您有帮助.
Dear,
You have create custom page using User controls and webpart. Then you can use .Net code Logic for generating request id.


Use Object model for inserting items in List. Below is steps for that

Steps:
1. Create an User Control and use Microsoft.Sharepoint namespace by using keyword.

2. on add or submit button, use your generate requiest id logic and then SPSite mySite=new SPSite["Url"];
SPWeb myWeb=mySite.openWeb();
SPList myList=myWeb.List["ListName"];
SPListItem NewItem = ListName.Items.Add();
use columns as you have
myList.Name=txtName.text.trim();
Same as other columns
NewItem["Name"] = txtAskSaad.Text;
NewItem"Date"] = System.DateTime.Now;
CurrentWeb.Update();

3. Create a class type solution in Visual Studio 2005 and then
use user control on that webpart.

3. deploy solution
4. entry in web.config as safe control

and use this webpart in your application


Hope it will help you.


这篇关于生成请求ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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