TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anjali Khan
NA
867
224.5k
ow to display auto generate id with username with year in as
Dec 28 2017 6:53 AM
ow to display auto generate id with username with year in asp.net
How to display auto generate id like Ashu/2017/1
here 1 is auto generate id and ashu id login name .how to do this
note - i created form n submit in db aftr dispaly records in gv i want UserId - Ashu/year/1
in my table todays date column is there for generate today date .so here is showing year also so how to bind year with userid column
My procedure is
ALTER PROC [dbo].[Records_Display]
(
@UserId int = null,
@PageIndex INT = NULL,
@PageSize INT = NULL ,
@RecordCount INT OUTPUT
)
AS
BEGIN
BEGIN TRY
SET NOCOUNT ON;
BEGIN
SELECT UserId,Designation,
CONVERT(varchar(20),LetterDate,103) as LetterDate,Convert(varchar(20),ReceivedDate,103) as ReceivedDate,[Subject],
year(TodayDate) as todaydate
FROM tbl_Records
order by UserId desc
END
and i kept in gv my cloumn like
<asp:TemplateField HeaderText="UserId." SortExpression="userid" HeaderStyle-CssClass="Text-Center">
<ItemTemplate>
<a href="javascript:void();" onclick="window.open('_ViewDetails.aspx?Id=<%#DataBinder.Eval(Container.DataItem,"UserId")%>','main','scrollbars=no,fullscreen=no')">
<%# DataBinder.Eval(Container.DataItem, "userid")%></a>
<asp:Label ID="lblUserId" runat="server" Text='<%# Eval("userid") %>' Visible="false"></asp:Label>
<asp:HiddenField ID="hidtodayDate" runat="server" Value='<%# Eval("todaydate") %>' />
</ItemTemplate>
</asp:TemplateField>
Reply
Answers (
4
)
Asp.net Core 2.0 PDF to Image conversion
Window Fom Code not work in Asp.net